Active
Project:
Gallery Assist
Version:
6.x-1.19-beta5
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 May 2011 at 13:01 UTC
Updated:
22 Jun 2011 at 16:51 UTC
I have a site in drupal_1/sites/new.mysite.com that I set up for a staging site, then when I go live with the site, I change it to drupal_1/sites/mysite.com and I run a script I wrote to update database tables including the GA tables gallery_assist_item.opath, tpath and ppath, and I delete all cache including cache_gallery_assist_data. The I try to create a Gallery and the images don't appear to upload and I can't see them anywhere. Am I missing a table that I need to update when changing domain names?
The existing galleries appear to still work.
thanks
Comments
Comment #1
ericpai commentedI forgot to add that the only way to get GA to work again was to uninstall the module and reinstall it and then it works again, but I have to recreate all my galleries.
I also have these installed:
Gallery Assist Upload and Import helper enabled 6.x-1.0
Gallery Assist ImageCache enabled 6.x-1.2
Gallery Assist Lightboxes enabled 6.x-1.4
Gallery Assist Views enabled 6.x-2.0-beta1
Gallery Assist User Interface enabled 6.x-1.19-beta5
Comment #2
ericpai commentedThe part that actually breaks is the ajax file upload part.
Comment #3
ericpai commentedI found that GA also stores the site path in the variables table as "gallery_assist_directory".
I changed that path and it's still not working.
I think I've narrowed it down to the function gallery_assist_save() in the gallery_assist.module file.
Around where it has if (file_create_path($upload_dir, 1)) {
It's not returning true for that in the newly duplicated site.
That function then calls the function "file_check_location($dest, $file_path)" in includes/file.inc.
My original site was sites/drupal2.mysite.dev/files/gallery_assist/27/gallery_assist625
So GA is passing in file_check_location('sites/drupal2.mysite.dev/files', 'sites/drupal2.mysite.dev/files/gallery_assist/27/gallery_assist625')
Then it calls the same function again with the image at the end this time:
file_check_location('sites/drupal2.mysite.dev/files', 'sites/drupal2.mysite.dev/files/gallery_assist/27/gallery_assist625/beach.jpg')
For my duplicated site (drupal3.mysite.dev), it only calls this function once with this data:
file_check_location('sites/drupal3.mysite.dev/files', 'sites/drupal3.mysite.dev/files/gallery_assist/27/gallery_assist625')
Each time those functions are calling another function "file_check_location($source, $directory = '') " in includes/file.inc.
It then seems to fail in $check = realpath($source);
In the original site $check returns "/Applications/MAMP/htdocs/drupal_testing/sites/drupal2.mysite.dev/files/gallery_assist/27/gallery_assist625"
The duplicated site (drupal3.dev) returns nothing.
Anyone have any ideas?
Comment #4
ericpai commentedI did another site copy and this time I did a mysqldump to a text file, then used the Linux "sed" command to find/replace all domain names to the new domain name and then imported the database and it still doesn't work.
I deleted all sessions and caches.
An existing gallery does not let me upload images to it. This time I'm getting a php warning of:
I think it may have something to do with the user.
Comment #5
ericpai commentedGreat Success!
It was the variable that was serialized in the "variable" table that holds the path for the files:
gallery_assist_directory s:40:"sites/new2.wxxx.dev/files/gallery_assist";
At first this didn't work because the find/replace I did only replaced the domain names. I discovered that the whole path is serialized also! So if you have a domain name switched that has the same amout of characters then it will work but if you're changing it to say new.wxxx.dev TO new2.wxxx.dev, then the serialize number has to change. In my example from 39 to 40 characters.
I changed this:
s:39:"sites/new.wxxx.dev/files/gallery_assist";
to this:
s:40:"sites/new2.wxxx.dev/files/gallery_assist";
WHEW!
Comment #6
nlahm commentedThank you! I had exactly the same problem and your solution resolves it !