Changeset 15492
- Timestamp:
- 03/11/08 13:39:07 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.helper.datamanager2/type/image.php
r14808 r15492 972 972 function convert_to_storage() 973 973 { 974 foreach ($this->attachments as $identifier => $copy) 975 { 976 $this->update_attachment_title($identifier, $this->title); 974 // FIXME: better safety for image*s* datatype calling parent::convert_to_storage() 975 if (!empty($this->title)) 976 { 977 foreach ($this->attachments as $identifier => $copy) 978 { 979 if ($copy->title === $this->title) 980 { 981 continue; 982 } 983 $this->update_attachment_title($identifier, $this->title); 984 } 977 985 } 978 986 branches/MidCOM_2_8/midcom.helper.datamanager2/type/images.php
r14808 r15492 370 370 function convert_to_storage() 371 371 { 372 /* 373 * TODO: Title handling372 /** 373 * FIXME: Title handling (now handled separately by the images widget which is incorrect) 374 374 foreach ($this->attachments as $identifier => $copy) 375 375 { 376 376 $this->update_attachment_title($identifier, $this->_title); 377 377 } 378 */378 */ 379 379 380 380 return parent::convert_to_storage(); … … 490 490 { 491 491 // We have somehow broken data, try heuristics 492 $info['images_identifier'] = substr($identifier, 0, 32); 492 $info['images_identifier'] = substr($identifier, 0, 32); // NOTE: the 16 byte identifier is MD5 not GUID, so this is safe 493 493 debug_push_class(__CLASS__, __FUNCTION__); 494 494 debug_add("\$info['images_identifier'] was not set, used heuristics to set it to '{$info['images_identifier']}' (from '{$identifier}')", MIDCOM_LOG_WARN); … … 498 498 { 499 499 // We have somehow broken data, try heuristics 500 $info['images_name'] = substr($identifier, 32); 500 $info['images_name'] = substr($identifier, 32); // NOTE: the 16 byte identifier is MD5 not GUID, so this is safe 501 501 debug_push_class(__CLASS__, __FUNCTION__); 502 502 debug_add("\$info['images_name'] was not set, used heuristics to set it to '{$info['images_name']}' (from '{$identifier}')", MIDCOM_LOG_WARN);
