Closed (fixed)
Project:
Simplify Node Add
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
18 Feb 2010 at 23:01 UTC
Updated:
14 Mar 2010 at 14:30 UTC
diff -r1.1 simplify_node_add.module
34a35
> case 'notifications':
90a92
> 'notifications' => t('Notification settings'),
113c115
< }
\ No newline at end of file
---
> }
Comments
Comment #1
boran commentedOrganic groups notification can also be hidden simply this way too:
diff -r1.1 simplify_node_add.module
34a35,38
> case 'og_register':
> case 'notifications':
90a95,97
> 'og_register' => t('OG register'),
> 'notifications' => t('Notification settings'),
Hmm. Would also have been nice to only display a module in the list, if that module is enabled...
Comment #2
fabianderijkThe module list is actually a god idea as a addition to the drupal core standard form elements. I think I can do something with it. As soon s there is some time i will take a look at it.
Comment #3
boran commentedI tried to add the following around line 110, to add another key to the options array if the notifications module is installed
But Php complains: unexpected T_DOUBLE_ARROW
Comment #4
fabianderijkIsn't the correct code:
Hence the addition of array around "'notifications' => t('Notification settings'"
Comment #5
boran commentedYes that make sense.. now there is no php error but a new entry is added called "array". Hmm.
Comment #6
fabianderijkI will see if i can make a dev version of the module where the options are placed in a variable where you can easily add options.
Comment #7
fabianderijkthe dev version is commited, it will be online after it's rebuild at night.
Comment #8
boran commentedAfter installing the dev from 19th feb, I don't see the difference, at least not in the GUI.
In the code I don't see any reference to notifications, what variable do you mean?
Comment #9
fabianderijkOn line 84 of the module the array $field_types is started. In here you can add your own field you want to exclude on the node add or node edit page. Be sure to also add the field to the switch in the simplify_node_add_form_alter function. I will extend the hook the next coming days so you don't have to hack the module any more.
Comment #10
boran commentedThe patch in #1 above is what was done last time.
I was hoping you could include #1 and #4 so we could start covering the fields of several non core, but frequently used, modules out of the box.
Comment #11
fabianderijkHi Boran,
I will see what I can do. The problem with non-core modules is that I don't know where to draw the line if it's frequently used. That's why I want to extend the hook so people can use it to hide the fields of non-core modules and only support core modules natively. But I'm open for suggestions and try to make up a list with non-core, but frequently used modules and try to implement it in the module.
In the coming nightly build there will be options for notifications and organic groups.
Comment #12
boran commentedI understand you concerns. simplify_node_add_form_alter() is called on each node add/edit, so it needs to be kept as lightweight as possible too.
I tested the dev release (24th feb), very nice!
One issue:
In simplify_node_add_settings(), og_register should be moved to the section "if(module_exists('og'))".
There was a line added:
if($form['#id'] == 'node-form')
what is that for? To ensure there is no processing on form other than node add/edit and thus improve performance?
FYI I also tested it with Vertical tabs, which also improves the user experience. There was no conflict.
BTW if you are still looking for a co-maintainer, I'd be interested in helping. Tell me what you need/expect.
Comment #13
fabianderijkThanks for the compliments and testing. It would be nice if someone would help me co-maintain this module. If you would like to apply then it's OK with me! About the issue, it's fixed now, and will be available after the next nightly build.
The line "if($form['#id'] == 'node-form')" that was added in the latest version is indeed to check if the form processed is the form to add or edit the node. It isn't a necessary addition, but it will improve performance.
When you apply for a cvs account you can link to this issue to let drupal know that you have my approval as co-maintainer.
Comment #14
avpadernoFYI, I approved boran's application, to whom I granted access to this project repository.
Comment #15
fabianderijkThis was fixed in the latest dev release