Download & Extend

link attributes added to l() incorrectly

Project:Drupal core
Version:6.x-dev
Component:other
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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 KBIgnored: Check issue status.NoneNone

Comments

#1

Version:6.x-dev» 7.x-dev

To get more eyeballs, updated patch for D7.

AttachmentSizeStatusTest resultOperations
link-parameters.patch6.46 KBIgnored: Check issue status.NoneNone

#2

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

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 KBIgnored: Check issue status.NoneNone

#4

Status:needs review» reviewed & tested by the community

Tested, and reviewed the code, straightforward.

#5

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

#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 KBIgnored: Check issue status.NoneNone

#7

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

#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 KBIgnored: Check issue status.NoneNone

#9

Status:reviewed & tested by the community» fixed

Thanks, committed to Drupal 6!

#10

Status:fixed» closed (fixed)

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