Is it possible to remove the base path from the path which is saved to the database? Hard coding the base path causes headaches when moving from dev to production etc. When saving urls we should use the same format as used by the core file module with no base path set as the base path can change. To get the full path we can just wrap the saved database path in the url function.

I haven't played a lot with CCK as documentation is lacking (seriously lacking) but I have attached a patch to the imceimage_field funtion. It works for my needs but probably needs refining as it doesn't take into consideration the absolute url setting in imce, also I haven't had chance to do any proper testing yet other than does it work for the particular user case I need.

CommentFileSizeAuthor
imceimage.patch2.58 KBajevans85

Comments

yang_yi_cn’s picture

Assigned: Unassigned » yang_yi_cn
Status: Active » Needs review

i don't have the time right now, but i do have the same headache as yours. I'll definitely review your patch and try to commit it when I have a little bit time.

jlevis’s picture

I have just run into this problem as well, when migrating a development version of the site that was initially contained in a subfolder on the server then subsequently moved to the root directory on the new server. All the image paths are wrong after the move.

adamo’s picture

...actually, isn't the base path getting saved in the db really more of a files api issue?

agerson’s picture

I found the paths hard coded in content_type_NAME and was able to do a find/replace