Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2012 at 12:08 UTC
Updated:
5 Nov 2012 at 01:01 UTC
Role memory limit is a small module that allow you to set php_memory_limit per role.
Sandbox: http://drupal.org/sandbox/kevinn/1810870
git clone --branch 7.x-1.x username@git.drupal.org:sandbox/kevinn/1810870.git
Comments
Comment #1
klausiWelcome,
please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxkevinn1810870git
Comment #2
kevinn commentedFixed all the issues.
Comment #3
riho commentedIn the admin page I noticed that entering the value 0 allowed and it basically results in using whatever the system default is, maybe you should point that functionality out somewhere on your readme or project page.
Also the correct abbreviation of megabyte is MB not mb.
Module itself seems to work as intended from what I can tell.
Comment #4
kevinn commentedFixed.
No 0 MB should not be allowed.
Comment #5
mpdonadiorole_memory_limit_uninstall() gets all of the roles with user_roles(). This means that if you install module, configure module, delete a role, and then uninstall the module, you will have an orphaned variable in {variable}. The safest way to handle this situation is to implement a hook_user_role_delete(), and variable_del() from there. Doing a wildcard DELETE FROM {variable} may cause long term problems if you (or someone else) ever make a sub-module in the same namespace.
When I uninstalled the module, the variables for administrator, anonymous, and authenticated were left behind.
According to the docs for memory_limit, you can set the value to -1 to not have a memory limit, which is useful in some occasions. Your role_memory_limit_settings_form_validate() will not allow this.
You should also investigate a method to see if you can implement a hook_requirements() to test if this module will work on a user's system.
Comment #6
kevinn commentedImplemented hook_user_role_delete() to delete variable.
Fixed issue where variables administrator, anonymous, and authenticated were left behind.
Set memory limit to -1 works now.
Comment #7
mpdonadioThis issues I found all look resolved.
Comment #8
kevinn commentedAdded hook_requirements to check if it is allowed to change the memory limit.
Changed role_memory_limit_settings_form_validate to not allowed more then 2048 MB.
Comment #9
varunmishra2006 commentedHi kevinn
I had checked you module . Everything seem to be fine like coding conventions etc.
But suppose 100 users are online then the system will again and again set the php memory_limit. It does not seems to be right there.
Can you please elaborate why we need such module?
Comment #10
kevinn commentedThe idea started when i was managing a very big site with over 200 blocks.
So when i tried to go to the blocks page drupal crashed becuse the memory wasn't enough.
With this module you can give an admin more memory and still keep the original memory limit for all other users.
Comment #11
varunmishra2006 commented@kevinn
Thanks for explaining. Seems like a good idea under such conditions.
Comment #12
kevinn commentedComment #13
mpdonadiokevinn, two quick things.
The process isn't terribly clear, but the submitter should only set the status to Needs Review. Reviewers then set it to Needs Work or RTBC, as appropriate. As you set it to Needs Review, someone else should take a look at your last round of changes and then set the status. I will try to do this in the next day or two.
You will not get final approval for a very long time unless you get a Review Bonus: http://drupal.org/node/1410826 Your module appeared to be in good shape, but you should double check the tips for ensuring a smooth review: http://drupal.org/node/1187664 Also search the applications for "fixed" to see projects that got approved, and issues that popped up.
Comment #14
mpdonadioVisually, the last round of changes look OK, but I don't have a server where I can test out the hook_requirements() logic.
Comment #15
cubeinspire commentedThe error message on line 71 of the admin.inc file is not correct.
It sais: "Maximum allowed is 64 MB."
Where it should say: "Minimum allowed is 64 MB."
All the rest looks good, but please correct that text.
I guess this sandbox should be promoted to full project.
Comment #16
klausiThanks logicdesign for the additional review.
Thanks for your contribution, kevinn!
I updated your account to let you 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 get 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.
Comment #17
kevinn commentedFixed issue #15.
Thanks everybody.