Drupal 5.1
Required feature
I am very new to using this module. So if I do not understand something correctly, please correct me.
I followed your Doc example to the letter. (and thank you for all the work you did on buidling that tutorial - this module uses up some major brain cells learning it - there are so many great features) However, I believe I found an oversight and a bug while building the example.
Oversight:
The Container Sources and Topics should be ‘Required’ fields in the example. This way the User can not forget to select a value for the Nodes. A new user could easily over look tagging the Node. I find this especially true with Drupal v5 … where the Categories are collapsed and the Select boxes are not visible to the user. In the example, it could be very possible to have a lot of Nodes with no categories assigned.
Bug.
Making these ‘Required’ reveals a small bug. If you make Sources ‘required’, everything is find – because there is only one choice for each – and that’s either Blogs or News – so the proper category is assigned.
But for Topics, there are 3 choices and making this ‘required’ the program selects the first choice in the list (entertainment) if the User does not intervene. It should probably tell the User to make a choice, instead of grabbing the first in the list.
best regards and thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | category_required_select_0.patch | 2.32 KB | JirkaRybka |
| #1 | category_required_select.patch | 2.3 KB | JirkaRybka |
Comments
Comment #1
JirkaRybka commentedTo the "Bug" part:
This is exactly my problem: On our site we have set the Containers to Required status, but as stated above - the selection on nodes is hidden in a collapsed fieldset, and contains no "empty" value, so it defaults to the first Category in the list, and nodes are frequently submitted this way. This is clearly wrong.
I created a patch for this: In the non-required case, nothing changes. But if Required is set, my version replaces the "" item with a message "Select category", rather than removing it, so that selection defaults to this line and not any of the categories. Later on, if user submits without explicitly choosing a category, a new code in the form-validation catches it, and sets proper error on the form-item. So Drupal shows error message to the user, asking him to choose a category.
Additionaly, I changed the fieldset to be expanded by default, because Category-selection should always be considered while creating a node, so there's no point hiding it.
Patch attached.
Comment #2
bdragon commentedPatch committed to DRUPAL-5 and HEAD.
Thanks.
Comment #3
bdragon commentedChanging state.
Comment #4
JirkaRybka commentedOops, just removed a little bug from my patch. Ignore the one above, please, I'm attaching correct version now.
Comment #5
JirkaRybka commentedSorry, I didn't expect you to be so fast. Please note my little debug, the first patch didn't work well on Forums.
Comment #6
bdragon commentedHeh heh.
I'm subscribed to the entire issue queue.
Reintegrating patch now...
Comment #7
bdragon commentedOK, fixed.
By the way, do you have a cvs account? ;-)
Comment #8
JirkaRybka commented:-) No, I've no CVS account, and I'm not going to apply for one. Currently I'm updating my first-and-only site to 5.1, bumping into bugs all around the modules... So trying to correct everything I can, and throwing patches back to Drupal.org where it seems fitting. But this all is just a temporary burst of activity, otherwise I'm more-than-fully absorbed by running the site content-wise. I don't expect having time to do this stuff, once my update is finished.
Comment #9
JirkaRybka commentedChanging status, by the way.
Comment #10
bdragon commentedFair 'nuff.
Thanks for the patches!
Comment #11
bdragon commentedComment #12
(not verified) commented