Closed (won't fix)
Project:
Node import
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Aug 2008 at 13:38 UTC
Updated:
27 Feb 2011 at 10:07 UTC
The reason i ask, is current all the form functions are expecting the $edit var to be passed by reference, yet drupal_get_form uses func_get_args which seems to only ever pass things except objects by value.
I did some basic debug (print_r stuff) and they seem to confirm my assumptions that only the validation functions (called by hand, not by drupal_get_form) are able to pass by reference. Upshot of this, is $edit['errors'] is never set in the calling function and so never saved to the session.
Anyone please confirm/deny.
a_c_m
Comments
Comment #1
Robrecht Jacques commentedIt is possible that it only worked in 4.7.x and 4.6.x, and never in 5.x.
On the other hand. Everything that is
$editshould be in$_SESSION. The form handling is not "normal" for Drupal 5.x - the only way in 4.7.x to write a multipage wizard was to store things yourself in$_SESSION. Drupal 5.x changed that (making it feasable to write adrupal_get_form()wizard form), but node_import never converted and basically still uses Drupal 4.7.x like forms.See
function node_import_page()how$editis read and written to$_SESSION.Now, it _is_ possible that for some reason this does not work for downloading the errors.
Comment #2
a_c_m commentedThe problem is in that function node_import_page(), the $edit variable is passed by reference to the forms via drupal_get_form, but it gets caught up in the process and ends up getting passed by value - so the changes made inside the forms (ie setting the errors) never make it out of the function to be written into the session. A work around could be to write it into the session @ the end of each form function before returning the output.
Comment #3
Robrecht Jacques commented5.x is no longer supported. If you have the same issue with the 6.x branch please reopen.