link attributes added to l() incorrectly

JohnAlbin - February 28, 2008 - 08:27
Project:Drupal
Version:6.x-dev
Component:other
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

There are 9 calls to l() across 6 files that add parameters incorrectly. If you pass an html attribute in the $options array without putting it in attributes =>array() the html attribute will be ignored by l().

For example, theme.inc calls:

l($name, 'user/'. $object->uid, array('title' => t('View user profile.')))

But that should be:

l($name, 'user/'. $object->uid, array('attributes' => array('title' => t('View user profile.'))))

The other calls are similarly incorrect.

AttachmentSizeStatusTest resultOperations
link-parameters.patch6.35 KBIgnoredNoneNone

#1

JohnAlbin - April 14, 2008 - 00:47
Version:6.x-dev» 7.x-dev

To get more eyeballs, updated patch for D7.

AttachmentSizeStatusTest resultOperations
link-parameters.patch6.46 KBIgnoredNoneNone

#2

mikey_p - April 30, 2008 - 01:17
Status:needs review» needs work

patching file includes/theme.inc
Hunk #1 FAILED at 1552.
1 out of 2 hunks FAILED -- saving rejects to file includes/theme.inc.rej
patching file modules/blog/blog.module
patching file modules/comment/comment.admin.inc
Hunk #1 FAILED at 64.
1 out of 1 hunk FAILED -- saving rejects to file modules/comment/comment.admin.inc.rej
patching file modules/node/node.module
Hunk #1 FAILED at 135.
1 out of 1 hunk FAILED -- saving rejects to file modules/node/node.module.rej

#3

JohnAlbin - April 30, 2008 - 15:30
Status:needs work» needs review

Thanks for the review, Michael!

I should have checked the patch before asking for reviews on IRC. The code style change for concatenation broke the patch. Doh!

Re-rolled.

AttachmentSizeStatusTest resultOperations
link-parameters.patch6.47 KBIgnoredNoneNone

#4

mikey_p - May 1, 2008 - 17:47
Status:needs review» reviewed & tested by the community

Tested, and reviewed the code, straightforward.

#5

Dries - May 2, 2008 - 15:12
Version:7.x-dev» 6.x-dev

Good catch. Committed to CVS HEAD. Seems like it is easy to make mistakes ... wonder if we can do something about that.

Changing version to Drupal 6 for Gabor to review.

#6

JohnAlbin - May 2, 2008 - 15:46

#229817: Wrong use of l function in theme_username broke the DRUPAL-6 version of this patch. Just had to remove one section from the patch to get it working.

AttachmentSizeStatusTest resultOperations
link-parameters.patch6.03 KBIgnoredNoneNone

#7

Dries - May 2, 2008 - 19:21

Good catch. Committed to CVS HEAD. Seems like it is easy to make mistakes ... wonder if we can do something about that.

Changing version to Drupal 6 for Gabor to review.

#8

JohnAlbin - May 19, 2008 - 04:43

#258120: Homepage links by unverified users do not properly have rel="nofollow" set was a dupe of this, but got committed.

Re-rolling again.

Please commit before we get one-off patches for each of the other 7 broken l() calls. ;-)

AttachmentSizeStatusTest resultOperations
link-parameters.patch5.29 KBIgnoredNoneNone

#9

Gábor Hojtsy - May 19, 2008 - 07:10
Status:reviewed & tested by the community» fixed

Thanks, committed to Drupal 6!

#10

Anonymous (not verified) - June 2, 2008 - 07:11
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.