Closed (fixed)
Project:
Timefield
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Oct 2012 at 05:09 UTC
Updated:
5 Jan 2013 at 19:00 UTC
Jump to comment: Most recent file
In order for timefield to validate and format correctly, the validation object needs to call #field_parents before grabbing field information. This is useful for being embedded inside field_collections.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | timefield-field_collection_validation_fix-1821460-4.patch | 3.98 KB | wesnick |
| #3 | timefield-field_collection_validation_fix-1821460-3.patch | 1.98 KB | spadxiii |
| #1 | timefield-fieldparents-1821460.patch | 1.29 KB | japerry |
Comments
Comment #1
japerryPatch included here
Comment #2
spadxiii commentedMaybe it's better to use 'drupal_array_get_nested_value' instead of looping manually.
like so:
The if-statement would also check if $key_exists is true:
Comment #3
spadxiii commentedMade a few changes and additions to the patch in #1
I noticed that the validation didn't check for #required. I have added that, but perhaps things might be done simpler. :)
Comment #4
wesnick commentedFirst, thanks for posting patches! This was actually a big can of worms. There were some other things that weren't working correctly that I discovered when I started troubleshooting this. After adding some of these changes, of course, the tests failed.
Here is my take on it. Check to see that it works for you.
@SpadXIII, I am wondering about this part of the patch from #3, maybe you could give me a test case where this would fail without this strlen() part.
Comment #5
spadxiii commented@wesnick, I'm not sure where or why it happened. But when I was trying to figure out what went wrong, I was getting errors because the $value was an empty string.
I'll have a go with your patch later this week and will report back then. I will also see if I can come up with a test-case for the empty string.
Comment #6
spadxiii commentedI just applied the patch to the 7.x-1.x-dev (2012-Oct-08) and it seems to work just fine!
I couldn't come up with the test-case for the extra value-check. This probably happened because of me debugging/messing up the code while figuring out a fix :)
Comment #7
arrowConfirming the patch in #4 works.
Comment #8
wesnick commentedcommited, thanks all for your help testing
#c411a03