Download & Extend

Rel attribute should have an option to get automaticly turned on/off if link is internal/external

Project:Link
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

As mentioned here http://drupal.org/node/1366628#comment-5564012 from tomceek correctly, the solution to solve the issue #1366628: Warning: strpos() expects parameter 1 to be string, array given in _link_sanitize()...Line 509 of link.module. is rather an option than a whole take off or cut of failing code, since some may would like to play around with it a little bit more.

But finally I came to the conclusion that it makes more sense to better inject a more "complete" solution for an optional automatic rel removal if link is internal or external (depending on settings). By default the setting is to leave rel as set up before.

This way it makes it possible to decide for best practicees on the project with links from the admins side.

Comments

#1

Here are some screenshots how the change works and the patch follows. EDIT: the last picture should be shown first and then the 1. 2. and 3th. to understand the setting.

AttachmentSize
Link Test | Digidog's scratchpad - Mozilla Firefox_053.png 44.95 KB
Selection_054.png 184.08 KB
Selection_055.png 30.08 KB
Selection_056.png 231.91 KB

#2

heh ... oh man, sorry second picture is for the thirth setting. Here comes the correct 2nd picture for the setting of the thirth picture ...

AttachmentSize
Selection_057.png 160.24 KB

#3

And here comes the patch ...

AttachmentSize
rel_attr_option_on_off_if_internal_external-1441702-3.patch 3.05 KB

#4

huh? ok ... obviously some coding standart failure I found later ... Here is an optimized version without trailing spaces (hopefully)

AttachmentSize
rel_attr_option_on_off_if_internal_external-1441702-4.patch 2.59 KB

#5

Status:active» needs review

ok, after some wishes from IRC :-) ... here a version with better readable code but slidely more kb ;-)

AttachmentSize
rel_attr_option_on_off_if_internal_external-1441702-5.patch 2.66 KB

#6

Status:needs review» reviewed & tested by the community

ok, tested on 4 stages with different modules installed and different Drupal 7.x versions on Linux and Windows server. I would say ... for such a radios/form addon patch ... I can take it as "tested" to get the stuff in tonight ...

#7

Status:reviewed & tested by the community» fixed

committed and pushed to HEAD. (--dev)

#11

Status:fixed» closed (fixed)

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

#12

thanks Digidog :-P :-D :-D

#13

The patch in 5 and now in HEAD misspells automatically. Here's a patch (on 7.x-1.x) to fix it.

AttachmentSize
link-automatically-1141702-13.patch 834 bytes