This module offers a Panels display renderer plugin based on Panels IPE, which allows privileged users to lock entire regions on a panel using the plugin, so non-administrative users able to use Panels IPE can't modify the region marked as locked - add or remove panes, neither change the blocks arrangement.

It differs from Panels locks because it locks a single pane to a region, but this new plugin allows to lock an entire region instead.

Project page

https://www.drupal.org/sandbox/zekivazquez/2554555

Git clone command

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/zekivazquez/2554555.git panels_lock_region

Automated review on Pareview.sh

http://pareview.sh/pareview/httpgitdrupalorgsandboxzekivazquez2554555git

Reviews of other projects (Review bonus program)

  1. https://www.drupal.org/node/2541230#comment-10248411
  2. https://www.drupal.org/node/2545164#comment-10248459
  3. https://www.drupal.org/node/2554455#comment-10248517

Comments

Zequi Vazquez created an issue. See original summary.

PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

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.

gaja_daran’s picture

Hi Zequi,
I am unable to install your module due to the dependancy module.
dependencies[] = panels_ipe
No release history was found for the requested project (Panels_ipe).

gaja_daran’s picture

Status: Needs review » Needs work
rabbitlair’s picture

Status: Needs work » Needs review

Hi gaja_daran, thanks for your review.

I just added Panels as a dependency, so submodule Panels IPE gets downloaded when enabling panels_lock_region.

rabbitlair’s picture

Issue summary: View changes
rabbitlair’s picture

Issue summary: View changes
rabbitlair’s picture

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

Automated Review

Fix errors in automated review

Manual Review

Individual user account
Yes: Follows 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.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: 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
Coding style & Drupal API usage
* Implements hook_help()
It is recommended to get the basic understanding of the module to new users.
rabbitlair’s picture

Issue summary: View changes

Thanks for the review, azeiteiro. Following your advice, I just implemented hook_help() with a little description of module purpose.

Unfortunately, I can't fix the three erros on the automated review, as those three functions are method overrides, and it's mandatory for them to have the same name as the original method.

sheldonkreger’s picture

Hi Zequi

It looks like CodeSniffer is complaining about not using lowerCamel format in those method names. I understand that it may be out of your control since you're overriding other methods. Where do those methods originate, and is there a reason they aren't using the format CodeSniffer expects?

rabbitlair’s picture

Hi sheldonkreger,

Thanks for your comment. Those methods are from Panels module, the panels_renderer_ipe class implements a render plugin in which I am based to generate the region locks. To be precise, that plugin is implemented on file panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php from Panels module, and the exact methods are on lines 93 and 176.

Additionally, the ajax_change_lock function needs to have that name based on the way the Panels renderer plugin base class associates the AJAX calls to a function. Take a look to file plugins/display_renderers/panels_renderer_editor.class.php, from line 519 onwards.

Thanks.

sheldonkreger’s picture

Status: Needs review » Reviewed & tested by the community

Using those method names is the correct approach even though it's not fitting the ideal coding standards. Marking as RTBC.

rabbitlair’s picture

Thank you, sheldonkreger.

mpdonadio’s picture

Assigned: Unassigned » mpdonadio

Will take a look at this today or tomorrow.

mpdonadio’s picture

Assigned: mpdonadio » heddn

Automated Review

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

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: ...temp/plugins/display_renderers/PanelsLockRegionSelectiveIpe.class.php
    ---------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ---------------------------------------------------------------------------
     15 | ERROR | Public method name
        |       | "PanelsLockRegionSelectiveIpe::render_region" is not in
        |       | lowerCamel format
     77 | ERROR | Public method name
        |       | "PanelsLockRegionSelectiveIpe::render_pane" is not in
        |       | lowerCamel format
     88 | ERROR | Public method name
        |       | "PanelsLockRegionSelectiveIpe::ajax_change_lock" is not in
        |       | lowerCamel format
    ---------------------------------------------------------------------------
    
    Time: 252ms; Memory: 6Mb
    
  • 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.

You can ignore the errors; they are false positive because of the way ctools wants things named.

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.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: 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

Not seeing anything.

Coding style & Drupal API usage

PanelsLockRegionSelectiveIpe::render_region(), you can use drupal_attributes() instead of imploding yourself.

Can you add the CSS in PanelsLockRegionSelectiveIpe::render_region() instead of through the module .info?

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.

Not seeing anything. Assigning to heddn for a second look if he has time. If he doesn't in the next few days, I will approve this.

rabbitlair’s picture

Thanks for the review, mpdonadio. I just modified the code, so the CSS is added on render_region(), and now I use drupal_attributes, so no implosion comes :)

heddn’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
Licensing
Maybe: Follows the licensing requirements.
Coding style & Drupal API usage
  1. The permissions use the phrase "Selective IPE", like that is a thing. But I don't see a module by that name. This module is called something different. Re-wording things to tie Lock Region (name of the module) to Selective IPE (name of the IPE) would make it more clear. Maybe just rename the IPE?
  2. Adding a drupal_alter into the theme layer isn't really necessary. Themes can be modified in preprocess pretty easily. Or overriden entirely. drupal_alter('panels_lock_region_region_links', $vars['links'], $context);
  3. * How are the graphics in the images folder licensed? Do you have rights to use them?

Postponing on #3. If the answer is that full rights are available, then +1 on the RTBC.

rabbitlair’s picture

Hi heddn,

Thanks for your review. About your comments:

  1. The text on the permission makes reference to the panels renderer pipeline defined on the includes/panels_lock_region.pipelines.inc file. I have modified the permission text, so it matches exactly that pipeline name, Selective In-Place Editor. Anyway, if you feel it is still unclear, please, let me know.
  2. I will try to take a look on next days to remove that drupal_alter() call.
  3. I made the images myself with Gimp, so, yes, I have full rights to use them.

Thank you!

rabbitlair’s picture

Status: Postponed (maintainer needs more info) » Needs review
heddn’s picture

Status: Needs review » Fixed

Thanks for your contribution, Zequi! The only blocker was 18.3, so let's promote you. You can continue to improve the code as you see fit.

Re IPE naming: If the module is named panels lock region, I'd assume the IPE would have a similar name. Not too important though.

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.

rabbitlair’s picture

Thank you very much, heddn!

Status: Fixed » Closed (fixed)

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