Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
taxonomy.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Nov 2009 at 13:02 UTC
Updated:
11 Dec 2009 at 16:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
c960657 commentedThis removes all 'value' occurrences in taxonomy.module.
I'm not sure about the change to taxonomy_field_widget_error(). I don't understand when $element['tid'] or $element['value'] is set?
Comment #3
yched commentedThanks for tackling this, c960657.
Forum heavily uses taxonomy, and should be updated accordingly
forum_node_prepare(), forum_node_validate(), forum_node_presave()...
Beware that we don't want to change stuff like
'title' => $object->title[FIELD_LANGUAGE_NONE][0]['value'],, of course.It's very possible that some taxonomy or forum tests need to be updated to reflect the change.
About taxonomy_field_widget_error(): Mmh, actually that function should simply be
because taxonomy.module implements only one widget itself - so that other code branch is never executed.
Comment #4
c960657 commentedThis addresses the comments in #3.
The taxonomy tests were broken. field_attach_validate() just assumed that no tid was specified and did not throw an exception, but the test did not properly detect this (adding an assertTrue() to the catch block doesn't help, if nothing is caught).
Comment #5
yched commentedGood call on the variable renames in a few foreach() loops.
About the taxo test: I think the pattern used elsewhere to test whether an exception happens or not is:
+ the scope of $e is limited to the
catch (Exeption $e) { ... }block, so no need to reset $e between two try / catch sequences.Other than that, looks ready to me.
Comment #6
c960657 commentedDone (I assume your comment about $e was related to the previous implementation).
Comment #7
yched commentedCool ! RTBC.
Comment #8
dries commentedCommitted to CVS HEAD. Thanks!
Comment #9
yched commentedThe forum.module hunks were left out of the commit, forum tests fail on HEAD.
Comment #10
dries commentedFixed. Committed.
Comment #11
yched commentedThx Dries. Resetting title and priority for posterity.