I have just downloaded the newest version, and was pleased to see many things having been addressed. However the Link -> Go To URL does not work.
I had a look and found the problem.
In function theme_img_assist_inline the following line:
$output .= l($img_tag, $attributes['url'], array(), NULL, NULL, FALSE, TRUE);
should read as:
$output .= l($img_tag, $link[1], array(), NULL, NULL, FALSE, TRUE);
There is no 'url' attribute, and the second element of $link can be used.
This is working for me with internal and external URLs.
Thanks for the good work.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | img_assist-DRUPAL-5.url__1.patch | 13.23 KB | sun |
| #5 | img_assist-DRUPAL-5.url__0.patch | 13.18 KB | sun |
| #4 | img_assist-DRUPAL-5.url_.patch | 9.86 KB | sun |
| #2 | img_assist-DRUPAL-4-7.patch | 0 bytes | sun |
Comments
Comment #1
zoo33 commentedJust to double check, are you using Drupal 4.7 and Image assist 4.7-1.x-dev?
Comment #2
sunIt's true - $attributes['url'] is not set. Committed attached patch for 4.7.
However, the same bug exists in 5.x, but I'd like to find a cleaner solution for this issue there. I'll dive a bit into TinyMCE allowed tag attributes, since I'd like to turn
link=url,http://example.comintolink=url|url=http://example.com. This is badly needed for http://drupal.org/node/176157 so we can define any link type and independently assign an url.Comment #3
darrenlambert commentedSorry, yes I'm using Drupal 4.7 and Image assist 4.7-1.x-dev
Comment #4
sunAttached patch converts the
link=url,fooattribute tolink=url|url=foo.From my own testing I can say this is working. However, since existing tags are not updated (unless edited via TinyMCE *if* TinyMCE plugin is used at all), we need to update existing contents or we will need to have backwards compatible code in Img_Assist forever.
Comment #5
sunAfter discussing this with smk-ka, it seems that there is yet no way to implement an update converting all old tags into new ones.
Thus, revised patch adds backward compatibility including a tag attribute conversion in the TinyMCE plugin.
Tested with both TinyMCE and regular textareas.
Comment #6
smk-ka commentedA few notes:
.split(',');should read.split(',', 2);at several locations (because ',' could also occur as part of the url)$attributes['url']is unset, so you're additionally generating an E_NOTICE error.Comment #7
smk-ka commentedComment #8
sunThanks for reviewing! Committed attached patch to DRUPAL-5.
Comment #9
sunComment #10
(not verified) commented