Visibility setting should be encouraged to use defined constants provided by block module:

  • BLOCK_VISIBILITY_NOTLISTED instead of 0
  • BLOCK_VISIBILITY_LISTED instead of 1
  • BLOCK_VISIBILITY_PHP instead of 2
CommentFileSizeAuthor
#2 1045606.patch1.26 KBmontesq
#1 block.patch1.15 KBdroplet

Comments

droplet’s picture

Version: 7.0 » 7.x-dev
Status: Active » Needs review
Issue tags: +Quick fix
StatusFileSize
new1.15 KB
montesq’s picture

Status: Needs review » Needs work
Issue tags: -Quick fix
StatusFileSize
new1.26 KB

Find as attached the changes for hook_block_info. However, I don't know how to change block_example_block_info...

droplet’s picture

Status: Needs work » Needs review

block_example_block_info is come from examples module [http://drupal.org/project/examples]

jhodgdon’s picture

Title: Documentation problem with hook_block_info and block_example_block_info » hook_block_info doc should use visibility constants
Status: Needs review » Reviewed & tested by the community

Thanks, the patch looks good to me.

And please file a separate issue in the Examples for Developers project to fix their code/doc.

droplet’s picture

rfay’s picture

subscribe.

rfay’s picture

Status: Reviewed & tested by the community » Needs review

I support this change, but I would classify this as an interface change and think it's probably way too late.

Consequences of this change: Contrib modules that update to use the new constants will cause a fatal on version 7.0 (and perhaps others) of Drupal.

I'd say it needs review in light of that.

rfay’s picture

Status: Needs review » Reviewed & tested by the community

Whoops. Sorry, I'm on crack. I didn't realize the constants were already defined and just didn't make it in here.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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