Posted by guix on June 26, 2009 at 5:59am
| Project: | RealName |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
The "Rebuilding realnames" process launched from /admin/user/realname/recalc freezes. It only builds 110 realnames out of 600 users. Dblog gives me two PHP errors :
- referent : /batch?op=start&id=110
- message : strtr() [<a href='function.strtr'>function.strtr</a>]: The second argument is not an array in .../includes/common.inc at the line 891.- referent : /batch?op=start&id=110
- message : Invalid argument supplied for foreach() dans /sites/webinsu/www/htdocs/co/includes/common.inc à la ligne 874.
Comments
#1
subscribe
#2
I'll try to have a look at this, I need my realnames :)
#3
I think critical is diserved...
#4
Here's a patch against HEAD.
I tried for a long time to use drupal_write_record() results to test the existence of the record, but
drupal_write_record('realname', $realname, 'uid');always returns 2, even if the record does not exist in the realname table. Then I saw in the function definition in /includes/common.inc : It is the caller's responsibility to know if a record for this object already exists in the database.. So just using db_result(dbquery()) for the test.
I also moved the batch function to realname.admin.inc (a known problem of Batch API is that even if the functions called are in the same file, the file has to be specified in the batch array :
'file' => drupal_get_path('module', 'realname') . '/realname.admin.inc',Last change, we can start processing the users at UID=1.
#5
Thanks for the patch. It couldn't get it to apply easily, partly because it was created outside of the module root directory, so I re-rolled it relative to the root directory to make life easier on others. It's also against 6.x-1.x-dev instead of HEAD (though they might be the same, I don't know)
I can confirm that the patch fixes the freeze, but haven't reviewed the code to make sure that it's okay in other respects.
#6
Critical > normal (it breaks nothing and I just learned critical is only for this).
Hi Dane,
Someone corrects me if I'm wrong, but I guess the patches against CVS have to have this path (the CVS path to the module). Of course, if you're patching from the latest -dev it's different.
In fact there were 2 problems :
- the count was never getting to 100% > "freeze"
- new names were not added (I dropped drupal_write_record)
And a "enhancement" :
- move the batch functions in realname.admin.inc (it was in the TODO)
Could someone review the code ?
#7
I'm getting the same problem - the rebuild fails with this error:
An error occurred. /DRUPAL6/batch?id=26&op=do
Using the latest 1.x version. Has the patch been tested since the last comment?
#8
subscribe thx (have not tried patch), should I?
#9
Yes, please try the patch with the latest dev release and report back. Thanks!
#10
Why don't we just truncate the realname table instead of rebuilding all realnames since they are rebuilt next time they are requested anyway. We don't really need this batch process and a lot of people seem having trouble with it.
#11
Fixed by #579040: Some bugfixes.
#12
Included in 6.x-1.3