4

I have been tasked with upgrading EE for a new client. Upon viewing the content directly in the database - I am seeing, within each closing html tag {filedir_15}.

For example:

<h3>This is some content<{filedir_15}h3>

It would appear, that at some point - someone created a File Upload Directory with a "URL of Upload Directory" of /. Sigh.

It would APPEAR that EE has replaced all forward slashes in the content with {filedir_15}.

Has anyone seen this before? Is there any recourse? I'm afraid to simply delete the upload directory, because currently the forward facing site is not BROKEN because those forward slashes in the HTML are being added in (i'm assuming) through the standard replacement of the {filedir_15} variable. If I remove that reference, the code will likely simply render with the filedir variable in place.

Any help would be greatly appreciated.

1 Answer 1

4

I haven't seen this before, but we've never had anyone create an upload directory of /. before. My thoughts are you can do a FIND and REPLACE on template to correct, FIND <{filedir_15} and REPLACE with </ that should take care of all the closing tags, but I'm not certain if there maybe other '/' that might get skipped.

I included the < so that you specifically get all closing tags, but any other references to just {filedir_15} should remain, incase there are images or pdfs using the tag.

So…

  1. Rename the file_upload directory from / to whatever;
  2. Use Find and Replace as specified above;
  3. Assuming rename of / directory kept file path {filedir_15} your good, if not, you'd need to find the remaining {filedir_15} and replace with new {filedir_xx}

That should be it. Some tips…

This is relatively straight forward, but backup your database, then you can select the ALL TEMPLATES option in the FIND and REPLACE tool.

2
  • 1
    Thanks so much nonprofit_tech. I ended up doing something pretty similar. I was able to identify that this only happened in WYGWAM fields. So first I ran a query to find all fields in exp_channel_fields which were of the type 'wygwam'. Then I simply ran through each of those with a query similar to: UPDATE exp_channel_data SET field_id_x = REPLACE(field_id_x, '{filedir_15}', '/'); Commented Jan 3, 2013 at 17:43
  • Excellent. Glad its fixed. Commented Jan 3, 2013 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.