I have a CCK Number ratio widget field containing values:
0|Image
1|External video (Youtube, Google Video)
2|External image (PhotoBucket, ImageShack, Google Picasa)
3|External audio (Odeo, Podcast Alley, PodOmatic)
Each value corresponds to a conditional field as follows:
0: ImageField
1: Embedded Media Video
2: Embedded Media Image
3: Embedded Media Audio
When conditional fields are enabled, the ImageField is not shown when viewing the node directly. Editing the node shows it keeps its value, and Views still shows the value properly.
I can consistently get this behavior across all nodes of the content type by adding or removing the conditional setting on the ImageField.
Dev load and render shows the php value is still populated.
Fields 1-3 (Embedded media) all work fine. A single number on/off checkbox controlling a text area also works fine.
Comments
Comment #1
RoboPhred commentedThis worked fine on the previous dev version I was using, a recent change must have taken it out.
Marking as posponed based on the first comment of #438122: Create an integrated modules page.
I will try to look into it and patch it if I can.
Comment #2
RoboPhred commentedChanging the display types has no effect, it remains broken.
Changing the widget type back to "File upload" (ImageField is a widget on top of FileField) does not fix it.
Deleting and recreating the field did not fix it.
Here is the strange part: Creating a new content type with only a number on/off (values 0/1) checkbox connecting to an imagefield works...
Here ends my testing for now, I have been getting inconstant results.
I still have more tests to do on it, hopefully I can find a consistant cause for this.
Here is the entire dump of the content type.
Comment #3
RoboPhred commentedI have not been able to get a consistant cause for it. Currently I have a field which controls two image fields when toggled on/off. One imagefield works, the other does not.
Here is the result of my debug output in nodeapi view when the field is set to off, and the proper field is NOT being displayed:
Now, here it is with the control filed set to 1, with the proper field being displayed as it should be:
My control field is not hidden and rendered properly, yet its value is missing from content and it assumes that the other fields are orphaned...
The next thing I will look into is what the "show triggered" component actually does...
Here is the export of the testing content I am using. "field_test_image_3" works, "field_test_image_3_2" does not.
Comment #4
RoboPhred commentedTurns out this has nothing to do with third party fields, just the cck Number field as control.
Tracked it down to the conditional_fields_is_triggered
Here is some debug output from is_triggered
The second one has 0 in the array, yet the check returns false. This is because ($value) returns false if the value is 0.
I fixed it by replacing
if ($value && in_array($value, $trigger_values)) {with
if (isset($value) && in_array($value, $trigger_values)) {I am not sure if the check for $value is needed at all.
Comment #5
RoboPhred commentedComment #6
peterpoe commentedTested and committed. Should not cause any problem. Thanks!