Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
788e0c09
Commit
788e0c09
authored
12 years ago
by
Chris Leppanen
Browse files
Options
Downloads
Patches
Plain Diff
Re-organize FeedsProcessor::process() so that it is clearer.
parent
76c57fa2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/FeedsProcessor.inc
+6
-7
6 additions, 7 deletions
plugins/FeedsProcessor.inc
with
6 additions
and
7 deletions
plugins/FeedsProcessor.inc
+
6
−
7
View file @
788e0c09
...
@@ -109,15 +109,15 @@ abstract class FeedsProcessor extends FeedsPlugin {
...
@@ -109,15 +109,15 @@ abstract class FeedsProcessor extends FeedsPlugin {
// Check if this item already exists.
// Check if this item already exists.
$entity_id
=
$this
->
existingEntityId
(
$source
,
$parser_result
);
$entity_id
=
$this
->
existingEntityId
(
$source
,
$parser_result
);
$
update
=
$this
->
config
[
'update_existing'
]
!
=
FEEDS_SKIP_EXISTING
;
$
skip_existing
=
$this
->
config
[
'update_existing'
]
=
=
FEEDS_SKIP_EXISTING
;
// If it exists, and we are not updating, pass onto the next item.
// If it exists, and we are not updating, pass onto the next item.
if
(
$entity_id
&&
!
$update
)
{
if
(
$entity_id
&&
$skip_existing
)
{
continue
;
continue
;
}
}
$hash
=
$this
->
hash
(
$item
);
$hash
=
$this
->
hash
(
$item
);
$changed
=
$hash
==
$this
->
getHash
(
$entity_id
);
$changed
=
(
$hash
==
$this
->
getHash
(
$entity_id
)
)
;
$force_update
=
$this
->
config
[
'skip_hash_check'
];
$force_update
=
$this
->
config
[
'skip_hash_check'
];
// Do not proceed if the item exists, has not changed, and we're not
// Do not proceed if the item exists, has not changed, and we're not
...
@@ -128,15 +128,14 @@ abstract class FeedsProcessor extends FeedsPlugin {
...
@@ -128,15 +128,14 @@ abstract class FeedsProcessor extends FeedsPlugin {
try
{
try
{
// Build a new entity.
if
(
empty
(
$entity_id
))
{
if
(
empty
(
$entity_id
))
{
// Build a new entity.
$entity
=
$this
->
newEntity
(
$source
);
$entity
=
$this
->
newEntity
(
$source
);
$this
->
newItemInfo
(
$entity
,
$source
->
feed_nid
,
$hash
);
$this
->
newItemInfo
(
$entity
,
$source
->
feed_nid
,
$hash
);
}
}
else
{
// Load an existing entity.
// Load an existing entity.
else
{
$entity
=
$this
->
entityLoad
(
$source
,
$entity_id
);
$entity
=
$this
->
entityLoad
(
$source
,
$entity_id
);
// The feeds_item table is always updated with the info for the most recently processed entity.
// The feeds_item table is always updated with the info for the most recently processed entity.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment