Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Insert module has inserted my uploaded image with two bugs:
<a href="http://www.example.com/files/foo.png" class="colorbox colorbox-insert-image" rel="gallery-all"><img typeof="foaf:Image" src="http://www.example.com/files/styles/large/public/foo.png?itok=72jZh0Id" alt="" class="image-large" /></a>
- Bug 1: All links are still absolute, but the Use absolute paths checkbox is disabled for sure in the content type field settings. Default insert type is Colorbox large.
- Bug 2: There is a
?itok=72jZh0Id
attached where I have no clue what this is made for, but it's static and this cannot correct in all cases. - Bug 3: Several double spaces without a need.
Comment | File | Size | Author |
---|---|---|---|
#7 | colorbox_insert_absolute_1931114_7.patch | 5.08 KB | frjo |
Comments
Comment #1
quicksketchLooks like you are using Colorbox, which provides its own insert templates, it is probably responsible for bug #1 and #3.
Bug #2 isn't a bug at all, it's a new requirement introduced in Drupal 7.20. See the release notes: http://drupal.org/drupal-7.20-release-notes
Comment #2
frjo CreditAttribution: frjo commentedLook like I need to update the Insert template in Colorbox with the new features that has been added to the Insert module lately.
Will try to make time for that in the coming week.
Comment #3
hass CreditAttribution: hass commentedComment #4
quicksketchUpdating title for descriptiveness.
Comment #5
hass CreditAttribution: hass commentedThe more important here is that the paths are not relative to the webroot and causing several troubles like warnings in SSL sections.
Comment #6
hass CreditAttribution: hass commentedComment #7
frjo CreditAttribution: frjo commentedPlease test this patch. I have attempted to copy over all the new functionality from version 7.x-1.3 of the Insert module.
Comment #8
Remyf CreditAttribution: Remyf commentedIt seems the img tag (thumbnail) now has a relative source, but the a href tag still has an absolute path to the colorbox image.
Comment #8.0
Remyf CreditAttribution: Remyf commentedUpdated issue summary.
Comment #9
frjo CreditAttribution: frjo commentedComment #10
JBecker CreditAttribution: JBecker commentedI can confirm #8. $url is a relative path in Version 7.x-2.5 but $path still is an absolute path to the image.
Comment #12
uno CreditAttribution: uno commentedAs far as I can see this is not fixed, still there in 7.x-2.x-dev ( 2014-May-07) and in 7.x-2.5, so marking as active.
Comment #13
workplaysleep CreditAttribution: workplaysleep commentedSame problem with 7.x-2.8 for me it worked to do add the following code to colorbox-insert-image.tpl.php
Not the most elegant solution but simple and effective.
$p = parse_url($path);
if (isset($p['path']) ) {
$path = $p['path'];
}
print $path; "....
Comment #14
frjo CreditAttribution: frjo commentedComment #15
Olafski@frjo The absolute links seem to be still there, leading to different problems, see also the newer issue https://www.drupal.org/project/colorbox/issues/2644266. Why do you think they "work as designed"?