thumbFilePath shows full file path for some records
2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 4, 2022 (RSS)
I have an app that is quite old and has gone through many updates to CMSB. In the uploads table some of the older records have the full path for thumbFilePath[2...4] whereas newer records have the relative path. I tried to recreate each of the thumbnails but the file path does not update.
What is the best way to remove the unnecessary part of the absolute path and leave only the relative address so all records are consistent?
By daniel - January 4, 2022
Hey Jeff,
The simplest option would probably be to make a backup of the uploads table, open the backup file in a text editor and run a search/replace to make the paths relative, then restore from that backup. I'd also keep a copy of the original backup just in case something goes wrong with the search/replace.
Alternatively, if the discrepancy is causing issues on the front end because the paths aren't consistent, there's a CMSB function called realUrl() that converts relative URLs to absolute and leaves absolute URLs unchanged. Using this on the path before display would convert it into a consistent format.
Let me know if you have any other questions!
Thanks,
Technical Lead
interactivetools.com