Errors sending mails.

rsantiag - February 13, 2009 - 11:56
Project:Job queue
Version:6.x-3.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi there,

I´m trying to use Job Queue (6.x-3.0) for sending mails and when one of the arguments of the function is a stdclass (as language parameter is) you can find a lot of errors.

In order to solve this issue, you only need to modify the line 109 of job_queue.module (las stable version) with this:

watchdog('job_queue', 'Ran queued job "!description"', array('!description' => t($job->description)));

Hope this help sameone.

#1

everydayjones - February 21, 2009 - 05:35

I still get:

* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* recoverable fatal error: Object of class stdClass could not be converted to string in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 758.
* warning: preg_match() expects parameter 2 to be string, object given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.
* warning: preg_match() expects parameter 2 to be string, array given in /home/mylivepr/public_html/my_domain.com/includes/bootstrap.inc on line 761.

#2

fgm - February 27, 2009 - 17:09

I suggest you try modifying the line that looks like

<?php
        t
($job->description, unserialize($job->arguments)),
?>

in job_queue_list() to:

<?php
        t
($job->description),
?>

This loses the ability to pass parameters in the description, but will typically solve that problem.

#3

emichan - August 13, 2009 - 02:17
Status:active» needs review

Hi,
I had the same problem, so I created a patch for it.

All this does is filters non-scalar types out of the argument arrays before passing it to t().

It patches cleanly and works as expected on my test box.

Patched against latest HEAD from module root directory.

Cheers,
emichan

AttachmentSize
fix_t_scalars.patch 1.46 KB

#4

dalin - August 14, 2009 - 09:11

Elegant solution, but you are unserializing twice. Here's a working patch.

AttachmentSize
fix_t_scalars.patch 1.45 KB

#5

emichan - August 14, 2009 - 19:18

Hah,

I missed that - it was unintentional. :P thx!

#6

sneyerst - August 18, 2009 - 14:22

The patch file provided by dalin solves the problem for me.

Thanks guys!

#7

drumm - September 13, 2009 - 01:52
Status:needs review» fixed

Committed with a little code style cleanup.

#8

System Message - September 27, 2009 - 02:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.