Absolute Image Replace
Component ID
2255253
Component name
Absolute Image Replace
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
This module scans the content of a field and will replace any absolute image source urls with a local, relative location.
Why this module is needed?
- Content creators, when using a WYSIWIG, will often paste content when creating or editing. This can cause when images exist elsewhere since the paste will use the external url. If the site containing the image goes down or the image changes, this will cause the content to source a bad url.
- If content has been migrated or hand coded, the entry may contain an absolute url (even within the current site). This is bad for migration at a later date.
- Pasting an image in is much more nature for a user than using an upload utility.
What does this module do?
When a field (that has been specified) is saved, the module will check for any images with an absolute source. If found, the module will do one of two things.
- If the image is local, it will remove the host, leaving the url as relative
- If the image is a remote url, it will copy over the image and save it locally then reference the local directory
Settings?
There are only two settings at this time.
- A comma separated listed of fields.
- A path to store copied files.
Concerns?
The main issue that will come to light with this module is whether or not the user is allowed to copy the image. I have added a message informing the user that the image has been copied to their site and that they need to be sure that they are allowed to use it.
NOTE:
This is my first public module so bare with me.
