In general, Allows the admin to select which content types, taxonomies, access
role to restrict node page view access for specific nodetypes and redirect to
404 as well as from crawlers and bot for this site. Currently there are two
features implemented.

Restrict node view by Content Types and Taxonomy Vocabularies

When a user is restricted, that user will not be able to view for selected user
roles.

Restrict data by Robot.txt for bot/crawler

When a Content Type and Taxonomy Vocabulary are restricted, that Content Type
and Taxonomy Vocabulary will not be available to crawl by the any bot/crawler.
Robot.txt will disallow it. To enable this feature, we must enable robot.txt
drupal module [https://www.drupal.org/project/robotstxt].

Note: You must delete or rename the robots.txt file in the root of your Drupal
installation for this module to display its own robots.txt file(s).

Install

1. Follow the instructions at
https://drupal.org/documentation/install/modules-themes/modules-7.

Usage

1. All configuration can be managed from administration pages located at
Administration > Configuration > Content authoring > Restrict Node Page View
404 Settings
.
2. Checked individual node/content types for node view restriction, fieldset
located on the "Restrict Node types".
3. Checked individual taxonomy vocabularies for node view restriction, fieldset
located on the "Restrict Taxonomy Vocabulary".
4. Checked individual roles for node view restriction will apply, fieldset
located on the "Restrict Role Users to view Page".
5. Select a page whare restricted node view will redirect, fieldset located
on the "Redirect To". Currently there are three options - Home Page, Page not
Found, Page access denied.
6. Select "Yes" if we want to restrict above selected "Content Types and
Taxonomy Vocabularies" from bot/crawler, fieldset located on the "Disallow to
robots.txt". To use this feature, we must enable robot.txt drupal module
[https://www.drupal.org/project/robotstxt].
7. To remove, simply unselect its value, and submit the configuration form.

Project Information:

https://www.drupal.org/sandbox/sajib_hassan/2404581

GIT clone command:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/sajib_hassan/2404581.git

CommentFileSizeAuthor
settings_25.png69.7 KBsajib_hassan
menu_7.png12.1 KBsajib_hassan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

polaki_viswanath’s picture

Hi,

I would like to suggest you that you fix below mentioned points

Info file
1. Miss spelled word, change "taxonomies" to "taxonomy".
2. Line length must not exceed 80 characters.

Install file
1. Remove all the blank lines from the file.
2. Line length must not exceed 80 characters.

Module file
1. Line length must not exceed 80 characters.
2. Remove unused variables from the code.
3. Remove all the blank lines from the file.
4. Remove all the warning and errors like "Strict warning: Only variables should be passed by reference in node_page_view_404_is_restricted_role() (line 211 of /var/www/html/dcmood/sites/all/modules/contrib/node_page_view_404/node_page_view_404.module)."

Use http://pareview.sh for furthur development.

Thanks

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.

sajib_hassan’s picture

Hi polaki_viswanath,

Thanks for your suggestion.

I have worked on your mentioned point and fixed some of issues -

Info file
1. Miss spelled word, change "taxonomies" to "taxonomy".

Fixed it. thanks

2. Line length must not exceed 80 characters.

As per i know, "description" tag could not be multiple line.

Install file
1. Remove all the blank lines from the file.

New line was for readability purpose. Remove extra one new line. Thanks

2. Line length must not exceed 80 characters.

As per i know, code lines are NOT include in 80 characters. FYI, pareview.sh did NOT rise any 80 characters issue for code.

Module file
1. Line length must not exceed 80 characters.

As per i know, code lines are NOT include in 80 characters. FYI, pareview.sh did NOT rise any 80 characters issue for code.

2. Remove unused variables from the code.

I did NOT find any unused variables into function code other then Drupal hook parameters.

3. Remove all the blank lines from the file.

New line was for readability purpose. Remove extra one new line. Thanks

4. Remove all the warning and errors like "Strict warning: Only variables should be passed by reference in node_page_view_404_is_restricted_role() (line 211 of /var/www/html/dcmood/sites/all/modules/contrib/node_page_view_404/node_page_view_404.module)."

Fixed it. thanks

Already checked with http://pareview.sh and found no error.

Thanks.

cfischer83’s picture

Hi,

Nice module. Here are some recommendations:

  1. In the .module file the node_page_view_404_form_alter function on lines 46 and 47 have some lines that extend very long. Consider breaking this into multiple lines to avoid one long line.
  2. Consider renaming node_page_view_404_redirectTo to not be camel case. That would fit in with Drupal coding standards. https://www.drupal.org/coding-standards

That's it! Nice looking code :)

albertski’s picture

Status: Needs review » Needs work

The only other thing I found is:

In node_page_view_404.info you have:

recommends[] = robotstxt

but it should be:

dependencies[] = robotstxt

sajib_hassan’s picture

Hi cfischer83,

Thanks for your review.

I just updates as per your two recommendations.

sajib_hassan’s picture

Status: Needs work » Needs review

Hi albertski,

Thanks for your review.

I just removed "robotstxt" from "dependencies" from node_page_view_404.info. Since it's a recommended modules for a extra feature, NOT required.

Thanks.

MattDanger’s picture

Status: Needs review » Needs work

Nice work with this. Looks like it gives users additional features over the Restrict Node Page View module. I've reviewed the module functionality, UI and code. I only have two suggestions

  1. in in the UI config, /admin/config/content/node-page-view-404, I'd suggest setting the default #collapse state on all, or at least the first, fieldsets to FALSE to save the user a step.
  2. Line 199 of node_page_view_404.module. If the user does not have site_404 configured (it's blank by default), the page will just redirect to the front page, an unintended result. One of these could be possible solutions:
    • if ($path) {
        drupal_goto($path);
      } else {
        drupal_not_found();
      }
    • Add a drupal_set_message(t('Your 404 is page not configured. You must configure it before you can select the Redirect To: Page Not Found option below')with a corresponding <code>hook_requirement() warning.

Otherwise, this work looks good to me.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

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