In my test paragraph:
test1 test2
is only the last link correctly replaced.

I think that function _multilink_filter_others_process() is called only once.
There should be some loop to search&replace all /node/[number] links.

CommentFileSizeAuthor
matches.png6.33 KBBohus Ulrych
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Andy Inman’s picture

Title: Only last occurence is replaced » Only last occurence is on line replaced
Assigned: Unassigned » Andy Inman

Hi Bohus,

Thanks for the report. I have confirmed your findings - so it looks like you have found a bug! It works ok if you have a line-break between the links, but not if they are on the same line. I suspect the problem is in the regular expression used, but I need to investigate further,

So, as a work-around, use a line-break between the links - of course, that may not give the the required output, especially if you have the Convert line breaks into HTML or similar filter enabled.

Andy Inman’s picture

Title: Only last occurence is on line replaced » Only last occurence on line is replaced
Andy Inman’s picture

On further testing, I am not sure if this issue affects all link formats or just Generic HTML - it looks like the exact behaviour depends on what other filters are enabled and in what order. I need to investigate further.

  • Commit 0ee203a on 7.x-2.x by netgenius:
    Fixed bug in multilink_filter "Generic HTML" format. [#2259441]
    
Andy Inman’s picture

Priority: Normal » Minor
Status: Active » Needs review
  • Now fixed, see dev version.
  • Confirmed that this problem only affected Generic HTML format links.
  • Note, this bug is probably in the D6 version too.
Bohus Ulrych’s picture

Thank you very much, this dev version really fixed my issue.

Andy Inman’s picture

Title: Only last occurence on line is replaced » Generic HTML links - only last occurence on line is replaced
Status: Needs review » Fixed

Thanks for the update Bohus. Out of curiosity, how/why are you using MultiLink? Can you give me the address of the site?

I'm going to mark this as fixed. The same bug will probably be in the D6 branch too, but that's now down to some 60 installations and most people probably don't use this feature, so I'm not going to bother to fix it there unless there's some demand.

Bohus Ulrych’s picture

Hi Andy,
we are developing multilingual version (Entity Translation) of our corporate site - but the development site is not public of course.
I'm using multilink to generate correct URLs for the translations. Just from the /node/### links.
Thanks for your support.

Andy Inman’s picture

Thanks for that info - interesting. I originally designed MultiLink for D6, and I imagined that with D7's much better language support in general it might not be very useful for D7 sites. If you can, please let me know when your site goes live, thanks!

Status: Fixed » Closed (fixed)

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