Images Disappeared After Table Name Changes

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 28, 2011   (RSS)

Hi

After populating her website, my client decided that she wanted to change the titles of a couple of her web sections. I tackled this change thus:

1. Went through the Section Editors and changed Section Names, Table Names, and Viewer URLs as appropriate.
2. Went through website code and modified to reflect new table names.

Everything is working perfectly except for the images which now no longer appear on the website. The images have also disappeared from the CMS, ie there are no uploads associated with the pages even though they were there previously. As far as I can tell, the images appear to be still in the uploads directory - it would seem as if the link between the images and the pages has been lost.

Can you please assist?

Many thanks

Re: [newmediachoice] Images Disappeared After Table Name Changes

By Damon - April 28, 2011

Hi,

This happens because the uploads table stores the tables name and uses this to make sure certain records only appear in certain sections.

There are a couple of solutions to this.

Easy solution: You can change the section's label without changing it's actual table name. This would keep all of your upload record where they are. Change the actual table name back to what it was previously and update the templates and everything will work

Technical solution: If you absolutely need to change the name of the table, you can run an SQL query to change all the upload records with the old name to the new name.

EXAMPLE
UPDATE cms_uploads SET tableName = 'NEW NAME' WHERE tableName = 'OLD NAME'

NOTE: Only attempt this if you are comfortable with MySQL. It is important to ALWAYS backup your database before attempting executing queries like this.
Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/