Reports 404 on unpublished pages.

403 to 404 is a simple module that emits a 404 error when a user tries to access a unpublished pages.

Sandbox:
https://www.drupal.org/sandbox/jagadeeshkony/2644342

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jagadeeshkony/2644342.git unpublished_404
cd unpublished_404

Comments

jagadeeshramuj created an issue. See original summary.

atul4drupal’s picture

Hello jagadeeshramuj,

A few suggestion to make your project page more standard:

Correct your Git Clone URL to :- git clone --branch 7.x-1.x http://git.drupal.org/sandbox/jagadeeshkony/2644342.git Unpublished_404

PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

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

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

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.

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.

shabirahmad’s picture

Issue summary: View changes

Automated Review

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.

http://pareview.sh/pareview/httpgitdrupalorgsandboxjagadeeshkony2644342git

Manual Review

Your hooks doxygen are missing the param directives. Its not important but it is encouraged to use. It will make your hook easily comprehend.

tobias.streefkerk’s picture

Hello jagadeeshramuj,

I took a look at your code and found the following issues:

- In the comment for your first hook you list hook_view_node_alter(), this should be hook_node_view_alter()
- Your code checks for an anonymous user (uid = 0). When the user is not anonymous, for say, an authenticated user, this would not work.

If you might ever want to port this module for Drupal 8, take a closer look at drupal_not_found().

Cheers!

tobias.streefkerk’s picture

Status: Needs review » Needs work
klausi’s picture

Status: Needs work » Needs review

That sounds like useful improvements, but surely not application blockers. Anything else that you found or should this be RTBC instead?

tobias.streefkerk’s picture

Nothing that are application blockers. I did find some other things when I looked at the code again:
- Hook node view access only works when viewing the full node. It does not prevent the rendering of menu items or anything of the like.
This is not a major issue because it should return 403 anyways, but I personally don't think that it can be left merely to the luck of the toss.
- I also don't really understand the flow of your module.. In your node hook_node_access you give a user permission to view a node and then call node_view_alter to give a 404.. So does that mean an anonymous user always gets the rights to view nodes?

I'll leave it up to klausi to change the status if desired, as he was right the first time and none of the above are application blockers.

namit.garg’s picture

Hi I have 2 issues
1>In the info file Please add Description which is more appropriate to working of module
2>.module file line 40 if ($node->status == NODE_NOT_PUBLISHED && $user->uid == 0)
This will work only for anonymous user.My site also has authenticated users which should see 404 errors instead of this you can use hook_permission() so that admin can select which user roles will get 403 error and which will get 404 errors.

pankajsachdeva’s picture

Manual Review

Code long/complex enough for review
[No: Does not follow] the guidelines for project length and complexity.

I think that code is not long enough to review. It just contains 34 lines of code.

pankajsachdeva’s picture

Status: Needs review » Needs work
klausi’s picture

Status: Needs work » Needs review
Issue tags: +PAreview: single application approval

Short modules are perfectly fine, we just can't give the git vetted user role away for them. Anything else that you found or should this be RTBC instead?

pankajsachdeva’s picture

I think, there is no other problem with it. I am marking it as RTBC.

pankajsachdeva’s picture

Status: Needs review » Reviewed & tested by the community
mlncn’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution! Giving you vetted Git user status based on this and the other three projects you've contributed to. You can promote this to a full project.

When you create new projects (typically as a sandbox to start) you can then promote them to 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.

Status: Fixed » Closed (fixed)

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