summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
906b784)
Item model delete all attachments on item deletion, but it should check
if same attachment isn't used somewhere else.
* This only applies to photos uploaded from the photos page. Photos inserted into a post do not
* generate a resource-id and therefore aren't intimately linked to the item.
*/
* This only applies to photos uploaded from the photos page. Photos inserted into a post do not
* generate a resource-id and therefore aren't intimately linked to the item.
*/
+ /// @TODO: this should first check if photo is used elsewhere
if (strlen($item['resource-id'])) {
Photo::delete(['resource-id' => $item['resource-id'], 'uid' => $item['uid']]);
}
if (strlen($item['resource-id'])) {
Photo::delete(['resource-id' => $item['resource-id'], 'uid' => $item['uid']]);
}
}
// If item has attachments, drop them
}
// If item has attachments, drop them
- foreach (explode(", ", $item['attach']) as $attach) {
+ /// @TODO: this should first check if attachment is used elsewhere
+ foreach (explode(",", $item['attach']) as $attach) {
preg_match("|attach/(\d+)|", $attach, $matches);
if (is_array($matches) && count($matches) > 1) {
Attach::delete(['id' => $matches[1], 'uid' => $item['uid']]);
preg_match("|attach/(\d+)|", $attach, $matches);
if (is_array($matches) && count($matches) > 1) {
Attach::delete(['id' => $matches[1], 'uid' => $item['uid']]);
--- /dev/null
+server:
+ memory: "1024" # MB