Insert module has inserted my uploaded image with two bugs:

<a href=""  class="colorbox colorbox-insert-image" rel="gallery-all"><img typeof="foaf:Image" src="" 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.
#7 colorbox_insert_absolute_1931114_7.patch5.08 KBfrjo


quicksketch’s picture

Project: Insert » Colorbox
Version: 7.x-1.3 » 7.x-1.5
Priority: Major » Normal

Looks 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:

frjo’s picture

Look 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.

hass’s picture

Version: 7.x-1.5 » 7.x-2.3
quicksketch’s picture

Title: Insert relative is broken » Insert integration needs to include "itok" query string for Drupal 7.20 and later

Updating title for descriptiveness.

hass’s picture

The more important here is that the paths are not relative to the webroot and causing several troubles like warnings in SSL sections.

hass’s picture

Title: Insert integration needs to include "itok" query string for Drupal 7.20 and later » URLs not inserted with relative paths
Version: 7.x-2.3 » 7.x-2.x-dev
Priority: Normal » Major
frjo’s picture

Status: Active » Needs review
5.08 KB

Please test this patch. I have attempted to copy over all the new functionality from version 7.x-1.3 of the Insert module.

Remyf’s picture

It seems the img tag (thumbnail) now has a relative source, but the a href tag still has an absolute path to the colorbox image.

Remyf’s picture

Issue summary: View changes

Updated issue summary.

frjo’s picture

Issue summary: View changes
Status: Needs review » Fixed
JBecker’s picture

I can confirm #8. $url is a relative path in Version 7.x-2.5 but $path still is an absolute path to the image.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

uno’s picture

Status: Closed (fixed) » Active

As 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.

DrupalThomas’s picture

Same 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; "....

frjo’s picture

Status: Active » Closed (works as designed)