The README.txt suggests using the l() function to provide a login link for 403 pages, but there is a bug in the example. The options array should be array('query' => drupal_get_destination()) instead of array('destination' => drupal_get_destination()).

The README.txt should also include information about the templating options. It took me a few searches and debugging to work out what was going on.

Status

Fixed in release 7.x-1.1.

CommentFileSizeAuthor
#1 customerror-readmetxtadj-2063765.patch1.56 KBalexkb

Comments

alexkb’s picture

StatusFileSize
new1.56 KB
gisle’s picture

Title: additional README.txt enhancements » Bad login prompt example in README.txt + templating options
Component: Code » Documentation
Assigned: Unassigned » gisle

Thank you for taking the time to report this and creating a patch.

You're right about the present example in the README.txt using the l()-function to provide a login link for 403 pages was wrong, and also that a correct options array for this function is array('query' => drupal_get_destination()).

However, the way the module is written, the destination url in the options array is never used. Instead, the module keeps track of the URL requested, and will always redirect to that. You can put anything (right or wrong) in the options array, and it will be discarded. In light of that, I've changed that line in the example to:

l('log in', 'user'),

without supplying an options array. Note that the redirect to the originally requested URL will still work.

Also thank you for adding a section about templating options to the FAQ. I've used that partion of your patch.

The changes resulting from this issue is in the latest development snapshot (7.x-1.x-dev, dated 2013-Aug-15). Please review.

In addition to updating the README.txt, I've put the module documentation online in the Community Documentation area. This is a wiki, and anyone can edit. This, I hope, will make it faster and simpler to get module documentation corrected and updated.

To anyone reading this: Feel free to improve on the CustomError module documentation.

  • Commit 188b241 on 7.x-1.x, 8.x-1.x authored by alexkb, committed by gisle:
    Issue #2063765 by alexkb: Added how to use templates to the FAQ section...
  • Commit 530878e on 7.x-1.x, 8.x-1.x by gisle:
    Issue #2063765 by gisle: Corrected code sample in README.txt about...
gisle’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Issue summary: View changes
Status: Needs review » Fixed

Fixed in release 7.x-1.1.

Status: Fixed » Closed (fixed)

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