Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Feb 2011 at 04:10 UTC
Updated:
29 Jul 2014 at 19:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yched commentedOdd. There are tests for the behavior, that currently pass. My manual testing, back in #932502: Changing allowed values in "List" fields, worked ok too.
However, it does seem that manually testing the behavior now indeed doesn't work.
Got to run right now, no time to apply the patch or check the tests.
Comment #2
mr.baileysAn additional validation handler outside of list_field_update_forbid() also checks for removal of an in-use list value, so your manual test might have correctly blocked you from removing a value prior to hook_field_update_forbid being invoked:
list_allowed_values_settings_validate() in list.module:161
When I disable the above form validation, I can successfully remove an allowed value even though it's in use, so Doug's assessment is correct. The automated tests also seem to only cover the form validation, not the list_field_update_forbid() invocation.
Doug's patch looks correct to me (although we should probably add a test against hook_field_update_forbid() for list.module), but leaving for someone with more field-experience to handle this...
Comment #3
sunThe patch is correct. And this means we have major bugs in our tests, in case this is indeed tested already. :(
Comment #4
marcingy commentedPart of the issue is that the tests did not create any field data to actually perform tests against so the logic was never being run. 2 patches attached first is test only and second is test plus fix above.
Comment #5
catchLooks great, one line fix, nice test.
Comment #6
yched commentedSorry, please don't commit just yet, something bugs me in the tests; just checking.
Comment #7
yched commentedSame fix, with a test that is slightly better integrated with the existing ones.
I dare say this is still RTBC, but I'll leave someone else push it back.
Comment #8
marcingy commentedComment #9
webchickEgad! Nice find, and thank you SO much for the tests on this bad boy.
Committed and pushed to 8.x and 7.x. Thanks!
Comment #10
boombatower commentedJust came across this bug, I couldn't believe it. :) Guess these things happen.