There are two plugins taxonomy and role.
While creating a new category I chose only taxonomy.
Prepared my email.
When I click send button I received error.
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1: SELECT u.uid FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid WHERE ur.rid IN (); Array ( ) in mass_contact_role_create_recipient_list() (line 42 of /var/www/registration/sites/all/modules/mass_mail/mass_contact/plugins/mass_contact_role.inc).
When I check the mass_contact.page.inc line 1025; I figured out that all plugins are running. There are no roles are selected and this gives error. Therefore, there should be a line
1- Either run a plugin if relevant data is selected
2- or do not run the query if array is empty.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | mass_contact_taxonomy.0001.patch | 2.34 KB | arkestra |
Comments
Comment #1
oadaeh commentedThank you for pointing this issue out to me. I will take a look at it.
Comment #2
jotwede commentedHaving the same problem with 7.x-1.0-alpha5 ...
Comment #3
arkestra commentedThis is still present in alpha6, though it seems there is code to handle Taxonomy terms.
Query for Roles throws PDO error when role is not selected.
Taxonomy:
This line: (~L42 plugins/mass_contact_taxonomy.inc) $query->fieldCondition($field['field_name'], 'tid', $tids, 'IN');
adds a trailing INT to the end of the table name. Not sure why.
Comment #4
arkestra commentedI have fixed the issue.
I have a patch for the most recent Drupal 7 version, and would like to commit it to the repo, but the plugins folder is not present in the repository. Is this a change in the structure of the module, or an effect of having installed the module?
My patch is attached for reference.
Comment #5
oadaeh commented@arkestra: you're making me nervous. Please don't commit anything, epecially if it's not on the correct version, and if you can't find the correct tree.
Comment #6
arkestra commentedDon't worry. Not gonna bother shoehorning it in if I can't get answers to questions.
Comment #7
oadaeh commented@arkestra: I assumed you knew what you're doing, but maybe you're new to all this. You need to be operating in the git branch for the version of Mass Contact you're patching. In your case, that would be 7.x-1.x. That is found on this page: http://drupal.org/project/mass_contact/git-instructions (master hasn't been used by most people since the migration to git.)
The plugin code needs some serious review as there are quite a few flaws in it. I started doing that a few months ago, but got sidetracked by one thing and then another until I now it's been so long that need to start over.
Recreate your patch based on the 7.x-1.x git branch (which should have the plugins directory in it), and then I'll review it for submission.
Comment #8
oadaeh commentedThis has been fixed in these commits:
http://drupalcode.org/project/mass_contact.git/commit/cfbb14a
http://drupalcode.org/project/mass_contact.git/commit/89d40de
Comment #10
arkestra commented@oadaeh Thanks for the tips. Was not not aware I was in the wrong branch.
Thanks for including the fix, will continue to monitor.