Just wondering if there is a known solution to migrating site image paths from "sites/default/files" to multi-site style "sites/sitename/files" particularly for Drupal 7 custom blocks that have had the images uploaded via wysiwyg editors and now being transferred to multi site image locations are all changing.
In D6 we used to just do an sql query and string replace the image paths and I thought this would be fixed in D7. I'm not sure what is best practise or what others do in this situation but it seems a rather backward approach.
Pathologic looks like a potential candidate but I don't like the idea of installing a module to fix paths if I don't have to.
In suggestions would be somewhat interesting.
Thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fix_paths_d7.patch | 2.4 KB | omega8cc |
Comments
Comment #1
omega8cc commentedThis is not a BOA problem, so moving the issue to the correct queue.
We don't replace paths in D7 because they no longer use the format known in D5 and D6, but it may still cause issues when content is edited with wysiwyg, so we should still replace paths also in
field_data_bodyandfield_revision_bodytables in thebody_valueandbody_summaryfields.Patch for review attached.
Comment #2
guillaumev commentedI have the same issue here but I'm not sure what you are proposing is the right approach to solve this. You would need to add to this list custom blocks, but also probably custom modules (I'm thinking about the "boxes" module) in order to make this work completely.
I must admit, though, that I don't have any other solution, but maybe the real solution is to find a way to avoid "hardcoded" images in blocks, pages etc...
Comment #3
guillaumev commentedI think the real right way to fix this is to actually use Media to handle images: that way, no more path problems, everything is handled by media...
Comment #4
snlnz commentedThanks for the response! :)
It would be good to catch the custom_blocks table also as mentioned many wysiwyg inserted image paths in custom blocks will break as well.
I will get a second boa machine up and running as soon as I can and review the patch but it looks good skimming over the changes.
Comment #5
steven jones commentedI really don't think that Aegir can't cover all the bases here, and we're bound to miss a few things for everyone if we try. Sadly, I'm going to have to say that: "You're on your own", sorry. As you have found there are other modules that help with changing paths, and I suggest that time is better spent on those, than adding Aegir specific code.