comparison mee.module @ 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
comparison
equal deleted inserted replaced
24:32d8c9f818a8 25:4df8f73dc0fe
190 $query = "INSERT into {mee_ressources} (content_nid, atom_sid, field, weight, required) VALUES (%d, %d, '%s', %d, %d)"; 190 $query = "INSERT into {mee_ressources} (content_nid, atom_sid, field, weight, required) VALUES (%d, %d, '%s', %d, %d)";
191 db_query($query, $node->nid, $sid, $field['field_name'], $weight, $required); 191 db_query($query, $node->nid, $sid, $field['field_name'], $weight, $required);
192 } 192 }
193 193
194 // @@@TODO: Handle failure of fetch 194 // @@@TODO: Handle failure of fetch
195 $atom = scald_fetch(scald_search(array('base_id' => $node->nid . ':' . $delta), FALSE, TRUE)); 195 if (variable_get('mee_register_composites', FALSE)) {
196 $atom->publisher = $node->uid; 196 $atom = scald_fetch(scald_search(array('base_id' => $node->nid . ':' . $delta), FALSE, TRUE));
197 $atom->title = $node->title; 197 $atom->publisher = $node->uid;
198 $atom->authors = array(scald_uid_to_aid($node->uid)); // @@@TODO: This will completely override any authors listed & replace only with the Publisher. 198 $atom->title = $node->title;
199 $atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included); 199 $atom->authors = array(scald_uid_to_aid($node->uid)); // @@@TODO: This will completely override any authors listed & replace only with the Publisher.
200 200 $atom->relationships = empty($scald_included) ? array() : array('includes' => $scald_included);
201 scald_update_atom($atom); 201
202 scald_update_atom($atom);
203 }
202 } 204 }
203 break; // end 'update' 205 break; // end 'update'
204 206
205 case 'delete': 207 case 'delete':
206 foreach ($items as $delta => $item) { 208 foreach ($items as $delta => $item) {