Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
forum.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2008 at 07:00 UTC
Updated:
8 Feb 2008 at 21:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
catchThis was my fault, introduced with the taxonomy forms cleanup when parents were switched on by default for all vocabularies. Shobaki's entirely correct. I also moved the variable_get to the top of the function which removes an if if and prevents a second one being introduced. Note this makes the patch look bigger than it actually is due to indentation.
Comment #2
catchAlso bumping to critical since this breaks functionality in unexpected ways. Please test!
Comment #3
Emad commentedworks perfect, now parent disabled only for forum terms,
thank you for the quick patch
Comment #4
cburschkaFollowup problem: Unsetting the parent field, which after this patch will only happen in the forum vocabulary, may be responsible for a notice in taxonomy.admin.inc:taxonomy_form_term_submit().
If it is, perhaps this patch could try to fix its notice while it's at it - possibly by using something other than unset() - '#type' = 'value'?
Comment #5
cburschkaApplied patch, tested, turns out this does cause the notice.
I'm changing unset() to the following:
This removes the notice without requiring a patch to taxonomy.module, and has the same effect.
Comment #6
gábor hojtsyWhat about wrapping it all in an if (isset($form['vid']) && $form['vid']['#value'] == $vid) and branch to the two form types from there? Would save us some repeating code, and would cleanup up how we focus our stuff on the proper taxonomy forms.
Comment #7
cburschkaDone.
Incidentally, there is one setting in the "designated forum vocabulary" that is reminiscent of the role settings in the user editing form. Namely, the designated forum vocabulary must always be attached to the forum topic content type, so this checkbox should technically be disabled.
It's probably not worth repeating what was just committed to user.module, as that change has to work around form API quite inelegantly. But if Form API gains support for individually disabled checkboxes in the future, both of these forms could use it.
Comment #8
chx commentedHiding form elements are best done with slapping an #access FALSE on them.
Comment #9
cburschkaFor sure!
Comment #10
cburschkaI'll be gone for at least a week. Let this be the final version, or someone else will have to take care of it.
Comment #11
gábor hojtsyLooks good except that we use much more "elseif" then "else if", so I'd use "elseif". This is a minor nitpick I can modify on commit. Otherwise with some more testing this looks good.
Comment #12
keith.smith commentedI rerolled this to use "elseif" instead of "else if", and to add a period at the end of one of the code comments (and since Arancaytar is afk). (Please no credit on commit for a two-character change.)
Comment #13
keith.smith commentedSorry, I should have tested this as well, while I was here.
On an *unpatched* copy, I created a new vocabulary and gave it some terms. Noticed that I received a notice regarding "parent" when creating a term, and that the Parent selector did not appear in the Advanced options fieldset for my new, non-forum related vocabulary.
Patched my copy. Created more terms for the same vocabulary, and noted that I did not receive a php notice, and that the Parent select appeared properly. Assigned some terms as parents of other tags, and confirmed that the hierarchy was reproduced properly when listing terms.
Went to the forums vocabulary and confirmed that the Parent select was, indeed, still not present.
So, as far as I can tell based on that, this is fine.
Comment #14
gábor hojtsyCode looks good, reviews are positive, so committed! Thanks.
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.