Download & Extend

Domain name change and GA stops working.

Project:Gallery Assist
Version:6.x-1.19-beta5
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:gallery assist upload error

Issue Summary

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

#1

I 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

#2

The part that actually breaks is the ajax file upload part.

#3

I 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?

#4

I 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:

warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/Applications/MAMP/tmp/php/phpHrYyBa' to '' in /Applications/MAMP/htdocs/drupal_testing/includes/file.inc on line 658.
File upload error. Could not move uploaded file.

I think it may have something to do with the user.

#5

Great 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!

#6

Thank you! I had exactly the same problem and your solution resolves it !

nobody click here