Skip to content
Snippets Groups Projects
Commit 53dfe8b3 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Simplify forced updating.

parent 714c9e35
No related branches found
No related tags found
No related merge requests found
......@@ -109,9 +109,10 @@ abstract class FeedsProcessor extends FeedsPlugin {
if (!($entity_id = $this->existingEntityId($source, $parser_result)) ||
($this->config['update_existing'] != FEEDS_SKIP_EXISTING)) {
// Only proceed if item has actually changed.
// Only proceed if item previously exists and forced updating is not
// enabled.
$hash = $this->hash($item);
if (!empty($entity_id) && $hash == $this->getHash($entity_id)) {
if ($entity_id && !$this->config['skip_hash_check'] && $hash == $this->getHash($entity_id)) {
continue;
}
......@@ -652,15 +653,10 @@ abstract class FeedsProcessor extends FeedsPlugin {
/**
* Retrieves the MD5 hash of $entity_id from the database.
*
* When "skip hash check" is set to TRUE, returns dummy md5.
*
* @return string
* Empty string if no item is found, hash otherwise.
*/
protected function getHash($entity_id) {
if ($this->config['skip_hash_check']) {
return '00000000000000000000000000000000';
}
if ($hash = db_query("SELECT hash FROM {feeds_item} WHERE entity_type = :type AND entity_id = :id", array(':type' => $this->entityType(), ':id' => $entity_id))->fetchField()) {
// Return with the hash.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment