Closed (fixed)
Project:
User Import Framework
Version:
6.x-1.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
17 Dec 2010 at 02:12 UTC
Updated:
7 Jan 2011 at 20:50 UTC
Recently I stumled upon the Drupal 5.3 compatabilty issue, specifically with ImageCache Actions module. But there are several other modules affected.
The bug regarding User Import Framework is that watchdog gets errors upon import saying:
Parameter 1 to uif_batch_import_users_process() expected to be a reference, value given in <drupal root>/includes/batch.inc on line 193.
Taking into account the comment over at the ImageCache Actions thread would suggest that my patch is harmless but fixes the problem. Since the call by reference never worked in the first place...
| Comment | File | Size | Author |
|---|---|---|---|
| uif-admin-inc.patch | 460 bytes | Michael Zetterberg fd. Lopez |
Comments
Comment #1
dwightaspinwall commentedThanks - this seems like the right thing to do but how do I pass $form_state by reference (which is what I intend)?
Comment #2
Michael Zetterberg fd. Lopez commentedSince you are using the Batch API it does not seem possible at the time. In _batch_process (batch.inc) the following code does the invocation:
To pass by reference you would need to alter that call_user_func_array invocation I think, making the result of the array_merge into a variable that is sent along. Like so:
Either this is by design or you could possible open an issue discussing the possibility to call by reference in Batch API.
Out of curiosity, why do you want $form_state by reference? It isn't used in a "by reference manner" anywhere in your code as far as I can tell.
Comment #3
dwightaspinwall commentedFrankly, I don't understand how the batch code works, or why the reference isn't getting passed along. But regardless, as you say, I don't modify $form_state; the only reason I'm passing it by reference is to save memory, which is probably not a good justification. So, I'll pass $form_state by value and commit this.
Thanks Michael!
Comment #4
Michael Zetterberg fd. Lopez commentedGreat!