Closed (fixed)
Project:
Gallery Assist
Version:
6.x-1.9-rc2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2010 at 09:26 UTC
Updated:
3 Mar 2010 at 15:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
fw_crocodile commentedThe problem is probably related to function gallery_assist_update()
Comment #2
fw_crocodile commentedThere are at least two problems.
First: you should probably move
$ganame = 'gallery_assist'. $node->ref;outside theif (count($node->gallery_items) > 0)or ganame could be undefined in// Delete the old gallery folder.Second:
$node->current_ownerapparently didn't exist in this scopeThird: $move_to_path should be
$move_to_path = $user_gallery_directory . '/' . $ganame;I'm investigating the current_owner problem. I will post a patch if I found a solution.
Comment #3
jcmc commentedHello fw_crocodile,
I have to investigate why is called my hook_delete.
You had right, a possible place of the issue is the hook_update.
I have created patches for GA v 1.8 and 1.9-rc2.
Can you test, please?
Regards and many thanks
Juan Carlos
Comment #4
fw_crocodile commentedI could not test the 1.8 for the moment.
But the 1.9-rc2 seems to work right.
I think the problem was that current_owner wasn't defined in the revision "page" so the condition
if ($node->uid != $node->current_owner)was true (may be a too simple check). And finally the gallery_assist_delete_directory was called with files/gallery_assist argument deleting all the contents (a watchdog() in the delete function could have leaved some trace in the logs).Two little error remain I think.
Use $ganame but $ganame is defined only if the precedent if statement is executed. (line 1608)
Sometimes you use
variable_get('gallery_assist_directory', file_directory_path() .'/gallery_assist')and sometimes only the hardcodedfile_directory_path() .'/gallery_assist/'.I think you should always use the first one (I may be wrong naturally). See lines: 1626 1627 1645
Thank's for the quick fix.
Anselmo
Comment #5
jcmc commentedHi Anselmo,
About the "two little errors",
Yes, a too simple check, I extend the check allready and here the patch.
The secund is not a bug, I have reasons so I use the two methods.
Thanks and regards
Juan Carlos
PS
I change the status to fixed, I remember you posted in the pas the same issue but I not find it by normaly search.
Comment #6
fw_crocodile commentedHi,
I didn't remember to have found a similar problem in the past, anyway the bug #682562: Creating new galleries causes deleting directories could be related to the same problem.
Comment #7
jcmc commentedThanks to fw_crocodile