Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
taxonomy.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Oct 2010 at 10:02 UTC
Updated:
3 Jan 2014 at 02:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedcatch asked for the content of {term_node} for those nodes.
Comment #2
catchHere's a patch for what I think the bug is.
To test this, looks like we need the following:
Vocabulary with single cardinality.
Node with at least two terms, the one that would be processed last needs to be the one in that single cardinality vocabulary.
After update, load the node and confirm that all the terms are in the right fields.
I won't be able to work on those tests for at least the next couple of hours, but may be able to look after that.
Comment #3
damien tournoud commentedThe bug can be reproduced with the upgrade path tests, we are just not asserting if the terms are associated with the correct vocabulary.
Here is an extension of the current test to test the fallback logic. This should fail.
Comment #4
damien tournoud commentedThe same patch with catch's fix. This one should pass.
Comment #5
damien tournoud commentedComment #6
LaurentAjdnik commentedHi all,
on a purely philosophical standpoint (the '+1' looks weird and brings a tiny additional calculation), I would write:
rather than:
Comment #7
damien tournoud commented@LaurentAjdnik let's rather stick with #4:
- this has to be consistent with http://api.drupal.org/api/function/field_default_validate/7
- the condition has to make sense: what we want to check is that the number of items is strictly bigger then the cardinality. The check in #4 is just that, the check in your #6 (while accurate and more efficient) doesn't carry out this.
Comment #8
catch#3 didn't fail.
Comment #9
damien tournoud commentedIt properly fails for me locally. I blame the test bot.
Comment #10
catchOK, going to test these locally and see.
Comment #11
chx commentedAt least the troubled line in the update needs more comments, "$delta[$field_name] +1" is the next delta and if that's more than the field cardinality........" or somesuch.
Comment #12
catchAdded an extra comment there.
Comment #14
catchwhitespace.
Comment #15
damien tournoud commentedThou shall fail.
Comment #16
damien tournoud commentedIgnore #16, this one should fail in a more meaningful way.
Comment #17
damien tournoud commentedThis one should pass.
Comment #18
carlos8f commentedNitpick: inconsistent spelling of "moreover", also seems a little repetitive.
Powered by Dreditor.
Comment #20
damien tournoud commentedLet's spin-off the XPath issue: #933856: xpath() return values are inconsistent
Comment #21
damien tournoud commentedWithout the hunks that got spined-off.
Comment #22
damien tournoud commentedSame as #21 with the text edits from #18.
Comment #23
carlos8f commentedEr... #22 is identical to #21 :)
Comment #24
damien tournoud commentedSorry, here it is.
Comment #25
ksenzeeShould be "In our test database, each node is arbitrarily associated with all terms except two: one whose tid is ($nid), and one whose tid is (49 - $nid)."
"to the taxonomy extra field."
Ideally if ($should_be_displayed) would go first but I won't quibble.
With just the doc changes (no need to move the if clause) this is RTBC.
Powered by Dreditor.
Comment #26
damien tournoud commentedDone.
Comment #27
ksenzeeLooks good. I verified that only comments have changed since the last testbot run (interdiff attached), so RTBC.
Comment #28
webchickWow, nice work, folks!
Committed to HEAD. Thanks!