Closed (fixed)
Project:
Drupal.org CVS applications
Component:
new project application
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
6 Oct 2010 at 14:34 UTC
Updated:
27 Nov 2018 at 10:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
markshust commentedI am attaching the simplify module. It is fairly basic and it's main functionality is to show/hide the tabs on the node create and edit pages. It's made solely for Drupal 7. Please let me know if you have any questions.
Comment #2
markshust commentedComment #3
avpadernoHello, and thank you for applying for a CVS account. I am adding the review tags, and some volunteers will review the code, pointing out what it needs to be changed.
Comment #4
markshust commentedIt's been about a week; just wanted to check in. This is a very simple module - I don't foresee there being any review probs. Let me know if you need any additional info.
Thanks,
Mark
Comment #5
Scyther commented1. Menu descriptions and titles, schema descriptions are not passed to t().
2. You are strongly encouraged to always use curly braces even in situations where they are technically optional. Having them increases readability and decreases the likelihood of logic errors being introduced when new lines are added. http://drupal.org/coding-standards
Comment #6
markshust commentedThank you for the review. I have attached an updated version of the module with some changes. I was already translating menu descriptions and titles in my first attachment of the module. I have updated the if statements to contain curly brackets. I have also made a bug fix and some enhancements to the if checking. Please let me know if there is anything else.
Thanks,
Mark
Comment #7
markshust commentedOops, I forgot to take out a die from testing in the last attachment. Please use this one.
Comment #8
markshust commentedSomehow that last one didn't zip correctly. Use this one.
Comment #9
Scyther commentedCoder found 1 projects, 2 files, 2 normal warnings, 2 minor warnings.
Please use Coder and correct the warnings.
Tested this module on Drupal 7, and it seems to work.
---------
But I don't really see the use of this. It removes this options ONLY for page nodes and for every user, even the admin user (uid 1). If a users that creates any types of nodes shouldn't see this options, it can be done with Permissions.
By reading your description about the module above and when I saw this code I got very confused. I get this feeling that if simplify_node_options is true (1) then the $form['options'] will be unset, part by the description you gave and by the variable name. But when I read "Show publishing options" as the title for the checkbox it came clear to me. This might only be me, but this was not easy to understand. More comments or new variable names, or change from "Show" to "Hide publishing options" would make this code better. But as I said, this might only be me that think like this, so this is only a suggestion from my side.
Comment #10
avpadernoI would expect too that the code should be, basing on the name of the variable:
In all that code lines is not necessary to strictly compare the variable value with 0 (or 1).
Comment #11
markshust commentedI initially thought about setting this in the reverse option as discussed (making boxes unchecked by default and checking to hide), but thought it would be easier for the user to understand the module by using it the other way around. Based on the couple initial feedback's I will definitely change it back as I guess my reasoning for changing it was not ideal.
Thanks for the coder link, last time I used it, it was not functional for d7. I obviously missed the "not" in the menu notation, I'll correct.
I was planning on adding in permissions functions after the initial release. The more I think about it, the more I agree with you that this would probably be a requirement for a 1.0 release. I'll add this in and submit the new code.
Comment #12
markshust commentedAll set. I updated the variable names, switched the logic around, and ran it through coder. I also added a new 'simplify node hide settings' role that will hide the fields only if the user is assigned to that role and is not the administrator. Please let me know how it all looks now.
Thanks,
Mark
Comment #13
Scyther commented1.
package = OtherThis is default, not needed.
2.
version = 7.x-1.0This is added by the CVS, so remove it.
3.
Think the title 'Nodes' are misleading, because your module only effects on the content type 'page'.
-----
There is no documentation about that this module only effects content type 'page', only in your first post here. I would like to see a note in a readme file or in the settingpage for this module.
Comment #14
markshust commentedRegarding item #1 & #2, I have removed these from the info file.
Regarding #3/documentation, I have added in the ability to either hide boxes for All nodes or just the Page node content type, and added verbose descriptions of each on the Settings page. I think this will help people using it more clearly understand what is going on and give the user managing these settings more flexibility.
Thanks,
Mark
Comment #15
Scyther commented1. Use drupal_substr in line 84 in .module
2. Why declare global $user; two times in function simplify_form_alter, why not put it in the begining in the function instead?
3. Why do you first use a switch for only one case, and after a if in simplify_form_alter? Why not combind those two to a switch or if/else if/else?
4. What if the content type 'page' dose not exists, then I think there should be no settings for that type. Or what do you think?
Comment #16
Scyther commentedSry, the link was to D6, and this module is D7, but think you got it.
Forgot to change status too.
Comment #17
markshust commented1. I am now using the drupal_substr module.
2. I declared it twice (within the if tags), because if I put it at the beginning of the function the global $user; will be called on every single page request drupal makes; even those which I am not modifying. I thought it was better to declare it twice and use them each time then to declare them on every single form drupal requests and not use them at all. Forms may exist which may never be content types, and the global $user will be called every time for no reason. Does this make sense?
3. I have modified the switch statement and got rid of the if statement.
4. I agree with this. How can I check if the 'page' content type exists?
Comment #18
markshust commentedI will upload the new version as soon as I get some feedback on my last posting. Thanks
Comment #19
Scyther commented1. Good.
2. It make sence, yes ;). I might have writen it to fast, because there is no right or wrong way to do that, what I know. But you will save lines of code with only declare it ones or you will save a microsecond or so if you put it in the if or switch. So do it the way you want.
3. Good.
4. You can use node_get_types() to get a list of content types and check.
Comment #20
markshust commentedThank you - attached is the revised module. I think the changes definitely have benefitted this module.
The node_get_types function is deprecated in d7, so I just used the _node_types_build function. Works just fine.
Please let me know if there is anything else. I will be actively updating this module on a regular basis with new features and capabilities once it is released.
Thanks,
Mark
Comment #21
markshust commentedJust wanted to check in to see if there were any other updates.
Thanks,
Mark
Comment #22
markshust commentedAnything? Been a couple weeks.
Thanks,
Mark
Comment #23
Scyther commented1. Use this function instead, node_type_get_types(). Know that thoose are (almost) equal, but this it the one to use.
Have you made any updates since your last attachment?
Comment #24
markshust commentedAttached is an updated module.
The key phrase in that quote is "once it is released". I don't want to devote my time and energy into this module if it never gets approved/released. It's a waste of my time and the reviewing team's time.
Comment #25
Scyther commentedOkey. The modules code looks ok and it seems to do what it should do.
Comment #26
markshust commentedJust checking back to see when the CVS account is coming, I would really like to get this out in time for D7.
Comment #27
avpadernoThank you for your contribution! I am going to update your account.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, 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.
I thank all the dedicated reviewers as well.
Comment #30
avpaderno