The read only node module simply allows you to set a node as read only by adding a new "Publishing option" to it.
The module commes with 4 new permission :

  • set node as read only
  • set node stiky
  • set node status
  • set node promote

When a node is set as Read only, only the role with the permission 'set node as read only' can edit it.

This module as been tested in a production site. In this site it was used for wiki content to allow particular role to 'lock' the wiki, even from the user who has created it.

Project page
https://www.drupal.org/sandbox/ttournie/2278257
Git
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ttournie/2278257.git read_only_node

Automated Review
http://pareview.sh/pareview/httpgitdrupalorgsandboxttournie2278257git

Manual Review

Comments

ttournie’s picture

Issue summary: View changes
madhusudanmca’s picture

Status: Needs review » Needs work

Automated Review

Best practice issues identified by pareview.sh / drupalcs / coder. Yes, http://pareview.sh/pareview/httpgitdrupalorgsandboxttournie2278257git reported number of issues that need to be address.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and fragmentation.
Master Branch
(*) No: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
(*) No: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
  1. hook_help() is missing in your module.

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.

I have tested your module functionality that looks good but due to lack of README.txt and master branch moving to Need Work.

ttournie’s picture

Issue summary: View changes
ttournie’s picture

Thanks for your automated review I have made some change accordingly

ttournie’s picture

Status: Needs work » Needs review
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.

naveenvalecha’s picture

Issue summary: View changes

Updated issue summary.

naveenvalecha’s picture

Status: Needs review » Needs work

Hi @ttournie
Thanks for your contribution in drupal.

Automated Review

Please follow the best practice issues identified by pareview.sh / drupalcs / coder.http://pareview.sh/pareview/httpgitdrupalorgsandboxttournie2278257git

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Maybe : Not confirmed about the duplication. Please specify the similar projects on the project page. Does not cause module duplication and fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
No: Follows the licensing requirements
3rd party code
NoYes: Follows the guidelines for 3rd party code.
README.txt/README.md
No: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
  1. line 111 // Add $ready variable. Please remove this as there is no $ready variable.Also update the comment hook_preprocess_HOOK() to hook_preprocess_hook()

This review uses the Project Application Review Template.

As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)

Thanks Again!

ttournie’s picture

Thank you,

I have done some changes and now it's good when I run the Autotmated review.

I do not understand the issues with 3rd party code (I dont have any).

About the review bonus, I'm going to see what I can do :)

ttournie’s picture

Status: Needs work » Needs review
naveenvalecha’s picture

Issue summary: View changes

@ttournie
It was the typo.I have updated my comment above. https://www.drupal.org/node/2344695#comment-9181347
Please udpate your project page https://www.drupal.org/sandbox/ttournie/2278257

please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)

ttournie’s picture

Ok

I have updated the .zip and .tar to the last version in my project page.

Do I need to update something else ?

Thank's :)

robin.ingelbrecht’s picture

Status: Needs review » Needs work
StatusFileSize
new28.53 KB
new25.03 KB

@ttournie,

Functionality of your module seems to work. There is one litthe flaw though:
When I configure my content type and mark "Read only" as default and then add a node of that content type, the flag "read only" isn't marked...
CT
node

ttournie’s picture

Thank you for the feedback :)

I have updated my code and now this issues is fixed.

ttournie’s picture

Status: Needs work » Needs review
darol100’s picture

Status: Needs review » Needs work

@ttournie,

Hook_help is missing .... Just like #2 madhusudanmca mention before having hook_help is a better practice in your module and it can be very useful for site builders.

Even if the hook_help is been pull of the README file will be fine. Here is an example that you can use in your code.

/**
 * Implements hook_help().
 */
function read_only_node_help($path, $arg) {
  switch ($path) {
    case 'admin/help#read_only_node':
      $output = file_get_contents(drupal_get_path('module', 'read_only_node') . '/README.txt');
      return module_exists('markdown') ? filter_xss_admin(module_invoke('markdown', 'filter', 'process', 0, -1, $output)) : '<pre>' . check_plain($output) . '</pre>';
  }
}

Beside of the hook_help your module seem to be working fine. Thanks for your contribution.

ttournie’s picture

Thanks darol100

I have added the hook_help as requested.

ttournie’s picture

Status: Needs work » Needs review
PA robot’s picture

Status: Needs review » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2349403

Project 2: https://www.drupal.org/node/2344695

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

ttournie’s picture

Assigned: Unassigned » ttournie
Status: Closed (duplicate) » Needs review
darol100’s picture

Status: Needs review » Needs work

I ran some testing on your module using the coder module and I got these errors.

read_only_node.module

Line 13: There should be no trailing spaces [style_trailing_spaces]

$output = '<p>' . t('The read only node module simply allows you
Line 14: There should be no trailing spaces [style_trailing_spaces]

to set a node as read only by adding a
Line 23: There should be no trailing spaces [style_trailing_spaces]

$output .= '<p>' . t(' When a node is set as Read only, only the role with
Line 23: The $string argument to t() should not begin or end with a space. (Drupal Docs) [i18n_11]

$output .= '<p>' . t(' When a node is set as Read only, only the role with

Please fix those warnings....

klausi’s picture

Status: Needs work » Needs review

Those warnings are surely not application blockers, please do a real manual review of the source code.

darol100’s picture

Status: Needs review » Reviewed & tested by the community

@Klausi

If those warning are not application blockers this module seem ready to me. He added the Hook_help that was I requested.

@ttournie

Great work thank you for your contribution

ttournie’s picture

Thanks @darol100.

Now I just have to wait I gess :)

kscheirer’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Sorry to be the first to bring this up, but

Duplication
This sounds like a feature that should live in the existing Custom Publishing Options project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the Custom Publishing Options issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.

If that fails for whatever reason or you feel that your module is significantly different, please get back to us and set this back to "Needs Review".

Only the hook_node_access() and hook_preprocess_node() functions provide something unique, and they are very short.

ttournie’s picture

Thanks,

I have created an issues in the project https://www.drupal.org/node/2449433

We will see how it goes.

ttournie’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
darol100’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

As we change our project application process in #2453587: [policy, no patch] Changes to the project application review process we are not allowed to block applications base on module duplication. We can still recommend collaboration over competition, but we should not enforce it.

PA robot’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2344695

Project 2: https://www.drupal.org/node/2349403

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

ttournie’s picture

Status: Closed (duplicate) » Closed (fixed)