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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix_t_scalars.patch | 1.45 KB | dalin |
| #3 | fix_t_scalars.patch | 1.46 KB | emichan |
Comments
Comment #1
everydayjones commentedI 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.
Comment #2
fgmI suggest you try modifying the line that looks like
in job_queue_list() to:
This loses the ability to pass parameters in the description, but will typically solve that problem.
Comment #3
emichan commentedHi,
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
Comment #4
dalinElegant solution, but you are unserializing twice. Here's a working patch.
Comment #5
emichan commentedHah,
I missed that - it was unintentional. :P thx!
Comment #6
sneyerst commentedThe patch file provided by dalin solves the problem for me.
Thanks guys!
Comment #7
drummCommitted with a little code style cleanup.