Closed (fixed)
Project:
Node Gallery
Version:
6.x-2.0-beta2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2010 at 20:35 UTC
Updated:
3 Jan 2014 at 02:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
x4ct0knife commentedOk so while doing some digging it seems that the function node_gallery_upload_js in node_gallery pages.inc is getting its form from the function modified in #765024: CCK & Node Gallery Solution
$form = node_gallery_edit_images_form($form_state, $cached_form['#node']);If this is the case data should be populated into the option widgets but it seems to only work on the "Manage Images" tab.
Comment #2
dddave commentedThis is weird. I remember testing this after the above mentioned issues were fixed and everything worked well (or I did not test it enough).
I tested with extensively and it boils down to select lists, radio button lists and check box lists not being displayed correctly on the upload screen.
Comment #3
x4ct0knife commentedThank you dddave for the validation, I stumbled across this while trying to apply a "mature content" radio selection to user uploaded artwork. A option such as this is crucial before I can display any artwork in a view.
Comment #4
dddave commentedI check on the original issue again and it seems that nobody really tested this on the upload screen. Given the fact that the main coder on this project (justintime) seems to be swapped by other things and that the focus lies on NG3 anyways I doubt that this issue will be tackled soon. So unless someone can provide a patch or justintime knows the solution in a split second advanced cck fields should not be used on the upload screen. Let's hope NG3 lands soon and in good shape so that we can leave NG2 behind.
Upgrading the priority nevertheless because this is quite a WTF.
Comment #5
justintime commentedActually, this is a fairly serious bug, and warrants a new 2.x release. I'm just wrapping up a big project, and should be able to fix this in the next week or so.
Comment #6
dddave commentedHi Justin,
glad to hear that. This bug should never have slipped in and I am beating myself pretty hard for it. I remember testing this extensivly but as it seems NEVER on the upload screen.
Hope you can find some time for NG soon. Looking forward to a NG3 release. ;)
Comment #7
justintime commentedMan, this bug just *has* to be in the only function that I have no friggin' clue what's going on in :). There's all kinds of wierd form voodoo going on in there. My best guess is that the form is getting munged and the #field_info property is being lost between lines 167 and 179 in node_gallery.pages.inc. To see if that's the problem, I have a quick hack that restores it if it's lost.
I don't have my test instance up - can someone test this patch and report back?
Comment #8
dddave commentedDoesn't seem to help.
Tested with:
Nodereference (-)
Text/ Selectlist or Radio buttons(-)
Decimal/ Selectlist (-)
Pollfield (-) -> Label shown but lacks the js magic to open the settings
Integer /Radio Buttons (-)
Those fields are working on the the manage screen though.
Link (+)
Decimal/ text field (+)
Embedded Media Field (+)
Integer /Single On/Off Box (+)
Working even on the upload screen.
Comment #9
justintime commentedWell, I have to admit, this one is beyond me. I've worked on it for at least 6 hours and can't figure out how any of this AHAH stuff even works in the first place.
There is some very low-level form hackery going on in node_gallery_upload_js(). This function never calls drupal_get_form(), so drupal_prepare_form() and drupal_process_form() are never called. These two latter functions are what execute the hooks that CCK is looking for to modify the form before it's displayed.
Every time I insert those two functions into node_gallery_upload_js(), the form renders properly (including cck optionwidgets), but the submission of the form blows up.
Someone with some deep knowledge of drupal forms and AHAH may be able to figure it out, but that's unfortunately not me.
Comment #10
dddave commentedSorry to hear that. This won't be an issue for NG3, will it?
If NG3 doesn't have this problem that would be ANOTHER good reason to migrate soon after NG3 stabilizes.
Thx for your effort!
Comment #11
justintime commentedNo, the AHAH upload form in 2.x is replaced with a plain CCK form or optionally a image_fupload form in 3.x, both of which fully support CCK.
Comment #12
justintime commentedI should've known better than to doubt the perfectionist in me.
I found some docs on AHAH, and it basically says that we're breaking every best practice in AHAH with the current code. I got to thinking, and realized we don't even need AHAH there, we just need a multistep form. What's more, getting rid of this will get rid of the 'http error 0' messages.
Attached is a patch that will remove the AHAH functions and replace it with a multistep form. CCK OptionWidgets work for me, please review.
Comment #13
dddave commentedWoah!
This seems to do the trick. All fields mentioned above in #8 seem to be working now. I am going to try to break this but after a first glance it looks like it is working.
AWESOME!
Comment #14
dddave commentedSo far, so good.
The only field not working is the pollfield. The settings can now be expanded but when you hit the "more options" button to create additional answers the form breaks. After that the upload cannot be submitted due to
call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'node_gallery_upload_form' was given in C:\Users\David\Sites\acquia-drupal-site\acquia-drupal\includes\form.inc in Zeile 376.That said, the problem might be due to pollfield which is in a very suboptimal state. In my opinion this shouldn't block the patch from getting in. Pollfields on imageuploads aren't that important I guess.
I would appreciate if someone else could test this patch btw...
Comment #15
dbeall commentedSeems to be working for me.
I haven't really used any cck fields on the images, just the main gallery content type. Might get into more of that this winter,, but probably will be NG3 though.
Comment #16
justintime commentedThat's 3 reviews including mine. Committing.