The return value of hook_perm is now supposed to be an associative array, with the value wrapped in t(). This patch updates the documentation.

CommentFileSizeAuthor
#1 hook_perm-281621-1.patch1.19 KBcburschka

Comments

cburschka’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

Here's the patch.

(I can commit this, I just need to know if the change is okay.)

lilou’s picture

Status: Needs review » Needs work

See : http://drupal.org/node/313213#comment-1052727

Now, hook_perm should use the following format:

<?php
function example_perm() {
  return array(
    'administer my module' => array(
      'title' => t('Administer my module'),
      'description' => t('Perform maintenance tasks for my module'),
    ),
    ...
  );
}
?>
gábor hojtsy’s picture

Right, patch needs to be updated to latest format as documented on http://drupal.org/node/224333#descriptions-permissions The array keys *should not* be wrapper in t(), but the title and description *should be*.

sun’s picture

Issue tags: +Novice
karschsp’s picture

Assigned: cburschka » karschsp
Status: Needs work » Needs review

I updated the example module at http://api.drupal.org/api/file/developer/examples/page_example.module/7/...
I guess it takes an hour or so for the changes to be reflected...
steve

dave reid’s picture

Not sure how often the API docs are updated, but I thought it was around 12 hours or so. You can view karschsp's change at http://cvs.drupal.org/viewvc.py/drupal/contributions/docs/developer/exam...

Status: Needs review » Needs work

The last submitted patch failed testing.

webchick’s picture

Status: Needs work » Fixed

Great job!

Status: Fixed » Closed (fixed)
Issue tags: -Novice

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