Improved code for Drupal 6

atuyo60 - August 2, 2008 - 15:23
Project:Protected node
Version:6.x-1.3
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi, I am upgrading my site to Drupal 6. I used to have this installed on Drupal 5 so I just took a look at your code to ensure it works. Thanks a lot for your work on this.

I have improved on your code to implement the proper coding standards and also made use of page handlers newly supported in Drupal 6 which would further reduce the memory usage of this module (although it is already quite small). Page handlers also makes it easier to edit the code when needed since the various menu calls are split up (I hope this would be part of a new release as it greatly benefits those on shared hosts with memory limitations).

I also applied the was_protected patch by Frank Steiner and changed the display text for users to something more general without the use of words like node that are unfamiliar to many. I have also edited the redirect url to include the node's title and place this title in the content of the password input form so users know which protected article they are accessing.

Also, the package for the .info file should use "Access Control" instead of "Access" since there are quite a few modules using the former and this would making it more organised on the modules page.

I have included all the changed files here since I do not have a patch program (sorry if this inconveniences your development)...

I am also currently working on implementing the Private Nodes module with this since development seems to have stopped on that module and I also think both modules complement each other.

If possible, maybe both could be merged into one release.

AttachmentSize
protected_node.zip4.5 KB

#1

Frank Steiner - August 11, 2008 - 20:02

I wonder how much redo this would mean for either you or me if your patch and my inheritance patch would both be accepted, as I more than trippled the size of the protected_node.module file :-) (At least I'm using drupal coding standards in the part that I changed or added, so it might be doable ;-))

Anyway, interesting to learn about page handlers, didn't know this so far! Maybe you are willing to test the inheritance patch to give me some feedback how it works for you...

cu,
Frank

#2

tolmi - October 14, 2008 - 09:42
Status:active» fixed

I've done the refactoring to myself because the given zip file and it's contents were useless. Please provide a patch in the future if you wish to contribute.

Thanks.

#3

Anonymous (not verified) - October 28, 2008 - 09:52
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.