Posted by ajzz on October 2, 2009 at 1:49am
Jump to:
| Project: | Classified Ads |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
After inserting a watchdog output clause in modules.inc, the cron timeout can be traced to this error:
Fatal error: Call to undefined function user_preferred_language() in /xxx/xxxx/xxxx/ed_classified/ed_classified_notifications.inc on line 90
Please help. The production system is running on cvs version with Drupal-5 tag. Disabling the classified module gets rid of the error.
Comments
#1
This is still an issue... any ideas?
#2
That error message ("Cron exceeding time limit") can be misleading. I had it happen when a bad PHP code snippet redirected to another page (cron calls the node rendering functions, which causes filters to be invoked, etc.) so it is possibly due to faulty node rendering somewhere in the classified module.
See: http://drupal.org/node/123269
and especially: http://drupal.org/node/123269#comment-644012
edit: Changed probably to possibly
#3
This might be fixed when #651388: What is latest recommended 5.x release? is resolved. Make sure you're using the latest release for 5.x on ftp.drupal.org, not just what appears to be recommended. Or when next major release of 5.x branch is pushed out.
#4
The error persists.
An up-to-date DRUPAL-5 tag CVS install uses a version of ed_classified.module more recent than 5.x-1-5-8 according to the revision chart at http://drupalcode.org/viewvc/drupal/contributions/modules/ed_classified/...
Also just confirmed: the server is also running the latest on the 5.x branch for the notifications file in the error above. Quoting from the file headers:
$Id: ed_classified.module,v 1.1.4.49 2009/09/07 11:01:38 milesgillham Exp $$Id: ed_classified_notifications.inc,v 1.1.4.4 2009/09/07 11:01:38 milesgillham Exp $Any further ideas? If there are specific ways to nail the problem that you want me to try, let me know. - Cheers!
#5
Corrected the version giving the error to the right branch.
#6
Hello Miles,
Just checked Drupal API.... See http://api.drupal.org/api/function/user_preferred_language
That function user_preferred_language is not available in the user module in D5. So this function should be removed from the notifications file.
The 3rd parameter required by drupal_mail in D5 is "$subject" http://api.drupal.org/api/function/drupal_mail/5
drupal_mail($mailkey, $to, $subject, $body, $from = NULL, $headers = array())This is what is holding up the cron and also the root of people not getting their notifications. In addition, all the other module crons get messed up due to this timeout.
I see you have caught this problem in the 5--2 devel branch. I tried copying that function over to the 5--1 notifications file, but still get pages of errors in watchdog saying "Unable to send ad expiration reminder email to user #xxx" until the cron times out (240 seconds?)... How well tested is the 5--2 branch? Is it worth risking a migration to that just so cron can run?
Hope this helps.
PS: for now, turning off notifications seems to let cron finish.
#7
This seemed to fix the problem, but still gives us no clue about what the issue it:
0) Dump the edi_classified_nodes table into sql and record the vid corresponding to the ed-classified module in vocabulary table.
1) Disable and Uninstall DRUPAL-5 tag module (this removes the ed-classified vocabulary noted above but leaves orphaned taxonomy terms still related to the old vid).
2) CVS downgrade to DRUPAL-5--1-5-8 and run update.php.
3) Load edi_classified_nodes data back into the table.
4) To prevent having to recreate all the views,subscription and feeds on the server using new taxonomy terms, manually change vid of new vocabulary created by install to old vid (removed by uninstall) in both the vocabulary table and variables table (to get rid of tampered vocabulary error). This step un-orphans the old taxonomy terms.
Upgrading to DRUPAL--2 CVS tag at step 2 did not work. There are still some critical watchdog errors (that I did not document).
So in a way, the above also answers the question: "which is the recommended D5 version?"
- Ajay
#8
Drupal 5 is no longer supported, and this was a 5.x specific bug (
user_preferred_language()being invoked in_ed_classified_send_user_notification_email()although it is a D6-D8 function only); so closing "won't fix".