Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
10 Aug 2012 at 12:52 UTC
Updated:
7 Sep 2012 at 07:51 UTC
The module allows a boolean type field within webform, with a return value if a checkbox is checked or not-checked.
This module was created as part of a client request to have the word 'No' returned if a certain checkbox was left unticked.
Core: Drupal 7
Project Page: http://drupal.org/sandbox/CTIDigital/1715136
Git: git clone http://git.drupal.org/sandbox/CTIDigital/1715136.git webform_boolean
Comments
Comment #1
gellweiler commentedI have activated your module and added a boolean type to a webform, but it will not render. It shows the message "The webform component boolean is not able to be displayed". It seems it trys to invoke "_webform_render_boolean" in webform.module:3540, which it can't find.
The git command posted in this issue queue will not work, because it contains your user, we can't authenticate as CTIDigital. This one should work:
git clone http://git.drupal.org/sandbox/CTIDigital/1715136.git webform_boolean.Comment #2
pjcdawkins commentedWhen I add a Boolean component to a new webform, I get the error:
I also get a Webform status message:
If I go back to the 'edit component' screen of the Boolean component, I get the above status message, and also the notices:
I don't get any form elements which allow me to define an 'on value' or an 'off value' for the component.
Comment #3
anthonyleach commentedHi,
Thanks for the quick reply to this. A bit of a fail on my part, I ran the automated test as mentioned in the things to do before posting here, this told me to always prefix function names with the module name, but this seems to break the webform. I have checked the other webform components and these are not prefixed with the webform module name at all. I have reverted the re-naming of the function names and tested this functionality again (just like I should have done after changing the function names) and all seems back to normal.
Can you guys check this out, I have altered the git clone line from the initial post, bit of a copy and paste mistake :)
Thanks again!
Comment #4
pjcdawkins commentedAh that would explain it! I'll have another look [changing status]
Comment #5
gellweiler commentedI have activated it. Seems to work now. It's a nice feature I think. You should add Screen shots to your projects page, so that people can see how the checkbox is going to look like.
Comment #6
gellweiler commentedI didn't wanted to change status. I must have accidental hit the item in the list.
Comment #7
pjcdawkins commentedWhen I add the new component, I get:
As shown in the automatic review (http://ventral.org/pareview/httpgitdrupalorgsandboxctidigital1715136git), you have several functions that need to be namespaced correctly.
All functions need to start with your module name, i.e. with
webform_boolean(with an underscore if you want to indicate they're private). So:_webform_defaults_boolean()should be_webform_boolean_defaults_boolean()_webform_render_boolean()should be_webform_boolean_render_boolean()etc.
Note: these functions are not actual hook implementations - see the Webform module's comments in
webform.api.php. So you can name these functions anything you like, provided they start with your module name in order to avoid conflicts.Comment #8
anthonyleach commentedHi,
Thanks for the info, I have just checked into this and it seems the webform module has it's own invoke function (webform_component_invoke) which does not prefix the module name before the function call.
Webform.module Line 3535
A callback of 'defaults' and a component type of 'boolean' would result in the function being '_webform_defaults_boolean'
Thanks
Anthony
Comment #9
anthonyleach commentedJust a quick note also, I have uploaded a screenshot of the component edit screen and also fixed the problem causing the notice.
Thanks
Anthony
Comment #10
pjcdawkins commentedAh I see.
Not marking RTBC yet, because procedure would probably want me to say:
Your project page is not very detailed, please have a look at the tips for a great project page, you may also use HTML-tags for better structure.
Comment #11
anthonyleach commentedHi,
I have added two new screen shots, one of the component display in the front end and the other of the display within the email body, I have also updated the known issue's section (a brief summary of the webform invoke function) and linked to the webform module and to the similar boolean field module.
Thanks
Anthony
Comment #12
pjcdawkins commentedThe function namespace thing isn't really a serious problem for your own module - it's just unfortunate for Webform that it doesn't allow other modules to override each others' component settings, etc.
There's now a typo on the project page: "componenent".
Otherwise good enough for me.
Comment #13
anthonyleach commentedHi,
Corrected the spelling mistake, what is the next step?
Thanks
Comment #14
pjcdawkins commentedSee http://drupal.org/node/539608 - now it's marked RTBC, wait for a git admin to find this issue.
Comment #15
CTI Digital commentedGreat! Thanks for your time
Comment #16
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #17
klausiComment #18
klausiCurrently your sandbox is not listed on your user account, so check your Git setup and your account mail address. See http://drupal.org/node/1022156
Thanks for your contribution, CTI Digital!
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 #19.0
(not verified) commentedChanged the git clone command