This module allows you to do "more" with the visibility settings for each block, it allows you to use Regular Expressions and allows you to Negate expressions. Pretty much allows you to do anything you want visibility wise.

Sandbox: https://drupal.org/sandbox/dubcanada/2210429
Repo: http://drupalcode.org/sandbox/dubcanada/2210429.git
Git Clone: git clone --branch 7.x-1.0 dubcanada@git.drupal.org:sandbox/dubcanada/2210429.git block_visibility_extras
Pare View: http://pareview.sh/pareview/httpgitdrupalorgsandboxdubcanada2210429git

Reviews:
* https://drupal.org/comment/8543041#comment-8543041
* https://drupal.org/comment/8543027#comment-8543027
* https://drupal.org/comment/8543025#comment-8543025

I've also gone through this before, https://drupal.org/node/2104037 my theme just wasn't big enough to become a "full project" person.

Comments

dubcanada’s picture

Issue summary: View changes
dubcanada’s picture

Title: [D7] » [D7] Block Visibility Extras
dubcanada’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
dubcanada’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

iampuma’s picture

Works great. Perhaps an extra check of the block module weight could be done in the block_visibility_extras_install() as this can be lower than -6.

dubcanada’s picture

Status: Needs review » Reviewed & tested by the community

I put up another check to adjust the weight based upon block module weight.

Also just a note if the project you review is in "Needs Review" after you review it you set it to "Reviewed & tested by the community" if it is good, otherwise you set it to "Needs Work". I've gone ahead and set the project to "RTBC".

dubcanada’s picture

Issue summary: View changes
dubcanada’s picture

Issue summary: View changes
barraponto’s picture

I don't want to hold this back but why does it need to change module weight? Why?

dubcanada’s picture

It needs to happen before the block module runs. That way we can do the regex/negating of the blocks, then any that are left over are assumed to be the regular way and can be processed normally.

So it follows this.

-> Get Blocks
-> Check to see if blocks contain regex or negating
--> If blocks do, run the same functions as block module runs to determine visibility just with regex and negating parts.
--> If block doesn't ignore and let block module run.

Otherwise block module would throw up due to unexpected characters (regex).

barraponto’s picture

Understood. Does hook_module_implements_alter help you?
Relying on module weights is a pain.

dubcanada’s picture

If you know another way to do it, let me know. hook_module_implements_alter appears (correct me if I am wrong) to lazy load hook calls? The problem is I need my module hook to run before the system/block.module hook. So it's a little bit trickier.

barraponto’s picture

nope, hook_module_implements_alter can alter the order the implementations of a hook are called.

dubcanada’s picture

Hrm it appears you are correct, my bad I guess I read that documentation wrong. It's on my list to add this in tomorrow.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

It appears you are working in the "7.x-1.0" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
The following git branches do not match the release branch pattern, you should remove/rename them. See http://drupal.org/node/1015226

* 7.x-1.0
  remotes/origin/7.x-1.0
  remotes/origin/HEAD -> origin/7.x-1.0

Review of the 7.x-1.0 branch:

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: /home/klausi/pareview_temp/README.txt
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
      1 | WARNING | Line exceeds 80 characters; contains 99 characters
     13 | WARNING | Line exceeds 80 characters; contains 172 characters
     21 | WARNING | Line exceeds 80 characters; contains 122 characters
     21 | ERROR   | Files must end in a single new line character
    --------------------------------------------------------------------------------
    
    FILE: /home/klausi/pareview_temp/block_visibility_extras.module
    --------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------
     43 | ERROR | Inline comments must end in full-stops, exclamation marks, or
        |       | question marks
     79 | ERROR | Inline comments must end in full-stops, exclamation marks, or
        |       | question marks
     82 | ERROR | Inline comments must end in full-stops, exclamation marks, or
        |       | question marks
    --------------------------------------------------------------------------------
    
    FILE: /home/klausi/pareview_temp/block_visibility_extras.install
    --------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     6 | ERROR | Doc comment short description must be on a single line, further
       |       | text should be a separate paragraph
    --------------------------------------------------------------------------------
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. I agree with using hook_module_implements_alter(), module weights are not reliable.
  2. This module on its own would be again too short to approve you as git vetted user, but since you already have a published theme I think we can approve you now.

Thanks for your contribution, dubcanada!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

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