Mass Contact does not work with Job queue

everydayjones - February 19, 2009 - 20:23
Project:Mass Contact
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

This doesn't seem to work. Here's what I've done.

1. I've set the Mass Contact to only allow 2 emails per hour (for testing purposes).
2. Sent the email off and it added it to the Job Queue.
3. When I go to: /admin/reports/job_queue I 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.

4. In /admin/reports/status, I see Job Queue (9 jobs), however all of them have the same time:

Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail
Thu, 02/19/2009 - 20:05 Queued Mass Contact Mail

5. If I run cron.php manually, all 9 jobs are sent, when it should only be sending 2 per cron run.

Am I missing something?

#1

everydayjones - February 19, 2009 - 20:27

Also, in admin/settings/job_queue it says:

Job queue
Job type Priority
All other functions 0

Shouldn't it show the Mass Contact priority here?

#2

everydayjones - February 19, 2009 - 22:18

Furthermore, when cron fires, it sends all emails. It doesn't send the 2 per hour.

#3

oadaeh - February 19, 2009 - 23:48
Title:Patch for send mails with job_queue (not working)» Mass Contact does not work with Job queue
Category:bug report» feature request

This module does not use the Job queue module. According to the Job queue module's main page:

This module is used by modules to queue function calls for execution on cron. The job_queue_add() function is used by modules to add a job to the queue:

I don't use the job_queue_add() function. If you wish to supply a working patch adding that functionality to Mass Contact, I will look at adding it.

Also, your errors appear to be from the Job queue module, not the Mass Contact module, so you should ask over there about them.

#4

rsantiag - February 20, 2009 - 07:15

Hi Jones,

Look at this issue:

http://drupal.org/node/373882

You have to modify one line on jobqueue module ...

For me it's working fine.

Hope I can help you.
Ricardo

#5

everydayjones - February 20, 2009 - 20:19

oadaeh - As you can see, rsantiag applied a patch for it to work with job_queue:
http://drupal.org/node/373893

#6

everydayjones - February 20, 2009 - 20:21

rsantiag - I applied the fix to line 109, yet I still have the same errors and all 5 job queues will fire at the same time:

Created Description
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail
Fri, 02/20/2009 - 12:09 Queued Mass Contact Mail

#7

oadaeh - February 21, 2009 - 04:01

@everydayjones: rsantiag created the patches necessary to get Mass Contact to work with Job queue. As Mass Contact officially stands, it does not support Job queue, and as such, neither do I. I suggest you comment on rsantiag's post where the patches are listed, instead of creating a new issue.

#8

everydayjones - February 21, 2009 - 05:32

Would be great if you could support it. It's a vital function for those behind server limits.

 
 

Drupal is a registered trademark of Dries Buytaert.