changeset 25:4df8f73dc0fe

Fields: Check the variable before updating a composite, too
author Franck Deroche <defr@ows.fr>
date Mon, 26 Apr 2010 16:12:35 +0000
parents 32d8c9f818a8
children e2ddb1e80df0
files mee.module
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mee.module	Mon Apr 19 10:51:33 2010 +0000
+++ b/mee.module	Mon Apr 26 16:12:35 2010 +0000
@@ -192,13 +192,15 @@
         }
 
         // @@@TODO: Handle failure of fetch
-        $atom = scald_fetch(scald_search(array('base_id' => $node->nid . ':' . $delta), FALSE, TRUE));
-        $atom->publisher  = $node->uid;
-        $atom->title      = $node->title;
-        $atom->authors    = array(scald_uid_to_aid($node->uid));  // @@@TODO: This will completely override any authors listed & replace only with the Publisher.
-        $atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included);
+        if (variable_get('mee_register_composites', FALSE)) {
+          $atom = scald_fetch(scald_search(array('base_id' => $node->nid . ':' . $delta), FALSE, TRUE));
+          $atom->publisher  = $node->uid;
+          $atom->title      = $node->title;
+          $atom->authors    = array(scald_uid_to_aid($node->uid));  // @@@TODO: This will completely override any authors listed & replace only with the Publisher.
+          $atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included);
 
-        scald_update_atom($atom);
+          scald_update_atom($atom);
+        }
       }
       break; // end 'update'