Sometimes we would like to know the blocks which are assigned (enabled / disabled) to a particular page. This module helps us to get the block(s) information by providing the page path.

This module helps us to find the blocks which are assigned through
1. "admin/structure/block" section
2. Context module

Project Link: https://www.drupal.org/sandbox/jnavane/2545284
Git Clone: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jnavane/2545284.git blocks_by_page_path

Please review the same and post bugs.

Manual reviews of other projects
https://www.drupal.org/node/2566179#comment-10372589
https://www.drupal.org/node/2575109#comment-10473508
https://www.drupal.org/node/2587825#comment-10473616

Comments

lslinnet’s picture

Title: Blocks By Page Path » [D7] Blocks By Page Path

Fixed title of the application.

jnavane’s picture

Status: Active » Needs review
pravin ajaaz’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxjnavane2545284git

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.

jnavane’s picture

Status: Needs work » Needs review
ajalan065’s picture

Good work.
Did not find any issue with the project

rashid_786’s picture

StatusFileSize
new114.81 KB
new129.81 KB

Hi thanks for your contribution here are my observations.

Automated Review

Found errors in automated review: http://pareview.sh/pareview/httpgitdrupalorgsandboxjnavane2545284git

Manual Review

Individual user account
[Yes] Follows the guidelines for individual user accounts.
No duplication
[Yes] Does not cause module duplication and/or fragmentation.
Master Branch
[Yes] Follows the guidelines for master branch.
Licensing
[Yes] Follows the licensing requirements.
README.txt/README.md
[No] Does not follow the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
[Yes] Follows the guidelines for project length and complexity.
Secure code
[Yes] Meets the security requirements. / No: List of security issues identified.]
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. * Implement hook_help() to help the users to get the basic understanding about your module.
  2. +As i tested the module on my local machine but could not find the block details by putting the path of page. Please refer attached images.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

jnavane’s picture

Thank you for your review updates.

I will have them fixed and update you the status.

pravin ajaaz’s picture

Status: Needs review » Needs work
Issue tags: -block +PAreview: security

Manual Review:

1. In hook_menu, you have created the menu with "access callback" => TRUE. So anonymous user can also visit admin/structure/block/blocks_by_page_path. Please create a custom permission and set the access argument.

2. Also you have not sanitized the "Block Name, Default Theme and Region" before rendering them. Please read through Handle text in a secure fashion. Use check_plain before creating $title, $default_front_theme, $region, $assigned_using values in the function ajax_find_blocks_by_pagepath

This creates a XSS vulnerability. Try creating a block with title <script>alert('xss');</script>, It will throw a alert message while finding it through the form you created.

The two security problems are blockers here.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

jnavane’s picture

Status: Needs work » Needs review

Hi Pravin & Rashid,

I have fixed the open issues and security issues which are posted by you guys.

Please review the same and let me know if I need to fix anything.

bisw’s picture

Hi,
I am not able to clone your project.

There are some issue by Drupal Project Application reviewers tools. Please check
http://pareview.sh/pareview/httpgitdrupalorgsandboxjnavane2545284git

prashant.c’s picture

Hi,

README.txt/README.md
[No] Follow the README Template.

Also your function names should start from your module name to prevent conflicts.

I saw you have used _get_block_title($module, $delta) etc. these should start with your module name.

It is also providing me wrong results.

For example :

1. I searched for node/31 it is providing me results for this also although this not does not even exist on my installation.

2. It should also display results on entering the path and hitting ENTER key, right now it only works on FIND button click.

prashant.c’s picture

Status: Needs review » Needs work
prashant.c’s picture

StatusFileSize
new79.39 KB

Forgot to attached screenshot for wrong results attaching the same.

jnavane’s picture

Hi Prashanth,

Thanks for posting bugs. I have fixed the issues which you posted. Please check it.

jnavane’s picture

Status: Needs work » Needs review
prashant.c’s picture

@Navaneethakrishnan

Yes now the functionality is working fine but i noticed small thing you haven't renamed function names in your .module file acc. to your module name.

luigisa’s picture

Automated Review

Found errors in automated review: http://pareview.sh/pareview/httpgitdrupalorgsandboxjnavane2545284git

Manual Review
README.txt/README.md
[No] Does not follow the guidelines for in-project documentation and/or the README Template.
Coding style & Drupal API usage
* Use the hook_help to give user support
* All functions should be prefixed with your module/theme name to avoid name clashes

ashishdalvi’s picture

Hi,

Automated Review

Coder Sniffer has found some issues with your code (please check the Drupal coding standards).

http://pareview.sh/pareview/httpgitdrupalorgsandboxjnavane2545284git

    ./blocks_by_page_path.module: all functions should be prefixed with your module/theme name to avoid name clashes. See https://www.drupal.org/node/318#naming

    function blocks_per_pagepath($form, &$form_state) {
    function ajax_find_blocks_by_pagepath($form, $form_state) {
    function _get_block_title($module, $delta) {

    FILE: /var/www/drupal-7-pareview/pareview_temp/blocks_by_page_path.module
    ---------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------
    62 | ERROR | If the line declaring an array spans longer than 80
    | | characters, each element should be broken into its own line
    ---------------------------------------------------------------------------

Manual Review

Individual user account
[Yes: Follows ] the guidelines for individual user accounts.
No duplication
No duplication found.
Master Branch
[Yes: Follows ] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.
README.txt/README.md
[No: Dose not follows] the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
[Yes: Follows] the guidelines for project length and complexity.
Secure code
[Yes: Meets the security requirements. / No: List of security issues identified.]
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. (*) Major finding, needs work
  2. (*) All functions should be prefixed with your module/theme name

  3. Just a recommendation
  4. 1. Readme.txt file dosen't follow the proper guidelines

    2. Configure link is missing in .info file configue=admin/structure/block/blocks_by_page_path

This review uses the Project Application Review Template.

Thanks,
Ashish

jnavane’s picture

Hi,

I have fixed all the issues which are recommended by http://pareview.sh/pareview/httpgitdrupalorgsandboxjnavane2545284git

Also I have added configure link in .info file.

Please review it.

Thanks,
Navaneeth

prashant.c’s picture

@Navaneethakrishnan

Yes the function names seems fine.

pravin ajaaz’s picture

Status: Needs review » Reviewed & tested by the community

Yes everything seems to be fixed now.

jnavane’s picture

jnavane’s picture

Priority: Normal » Critical
klausi’s picture

Status: Reviewed & tested by the community » Fixed

Git errors:

Review of the 7.x-1.x branch (commit dd4da8b):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: /home/klausi/pareview_temp/blocks_by_page_path.module
    ---------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------
     104 | ERROR | [x] Array closing indentation error, expected 6 spaces but
         |       |     found 8
    ---------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

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. project page is too short. What is the use case, having a search interface for blocks? Please follow the project page template https://www.drupal.org/node/997024
  2. blocks_by_page_path_ajax_find_blocks(): $header: all user facing strings must run through t() for translation.
  3. "t("No blocks found in specified path ':path'", array(":path" => $provide_value));": the ":" placeholder does not exist with t(), use "@" or "%" instead. See https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7
  4. why doesn't the page show all blocks by default if no path is selected?

But otherwise looks good to me, so ...

Thanks for your contribution, Navaneethakrishnan Jayabalan!

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.

jnavane’s picture

@klausi, Thanks for your review.

I have fixed the PAReview suggestion and translating string activities.

Main objective of this module is to bring up the blocks details assigned to a particular page. But I will consider your suggestion and work on it.

Thanks again.

Status: Fixed » Closed (fixed)

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