Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Attempting to delete a node with no URL records will cause an error. This is because there is no check being done to verify that there are actually any URL records before trying to delete them.
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: DELETE FROM {simplenews_statistics_click} WHERE (urlid IN ()) ; Array ( ) in simplenews_statistics_delete_clicks() (line 495 of simplenews_statistics/simplenews_statistics.module).
Comment | File | Size | Author |
---|---|---|---|
#10 | simplenews_statistics.module.patch | 701 bytes | ilaz |
Comments
Comment #2
dieuweFix committed to development branch.
Comment #3
Hooligan CreditAttribution: Hooligan commentedI just applied the update and still get an error when deleting a node.
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'votejuli_db.simplenews_statistics' doesn't exist: DELETE FROM {simplenews_statistics} WHERE (nid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 99 ) in simplenews_statistics_node_delete() (line 122 of /home/votejuli/public_html/sites/all/modules/simplenews_statistics/simplenews_statistics.module).
hmm, wonder why I'm missing a table.
Comment #4
Hooligan CreditAttribution: Hooligan commentedI confirmed, the module install is not creating the table named simplenews_statistics
Comment #5
dieuweAre you doing an upgrade from an older dev version? Have you run
update.php
?If so,
simplenews_statistics_update_7001()
should add the missing table.Either way, your problem is not related to this issue, so please do open a new issue if the problem is not solved by my recommendations above.
Comment #7
redhatusr CreditAttribution: redhatusr commentedI get the same error when I try to delete a newsletter
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: DELETE FROM {simplenews_statistics_click} WHERE (urlid IN ()) ; Array ( ) in simplenews_statistics_delete_clicks() (line 495 of /var/www/html/sites/all/modules/simplenews_statistics/simplenews_statistics.module).
I upgrade from alpha1 to dev version with this way:
1. drush dis simplenews_statistics
2. rm simplenews_statistics -rf
3. drush dl simplenews_statistics --dev
4. drush en simplenews_statistics
5. drush updb
the upgrade from alpha1 to dev version give me WSOD with i just view the newsletter and apache error log says:
[Thu Apr 23 05:41:25 2015] [error] [client 192.168.1.44] PHP Fatal error: Call to undefined function simplenews_issue_newsletter_id() in /var/www/html/sites/all/modules/simplenews_statistics/simplenews_statistics.module on line 70
any ideas?
Comment #8
zanscath CreditAttribution: zanscath as a volunteer commentedI got the same error when trying to delete a newsletter that hasn't been sent yet, not even to a test address. I think they didn't provide conditions for when no statistics are available for that node so perhaps you have to send it first or just click on the statistics tab for that newsletter at least once - I don't really know, but aster I did this, I could delete the newsletter.
Comment #9
rcodina CreditAttribution: rcodina commented7.x-1.0-alpha1 has this bug but it's fixed on dev branch. Please, create a new release with this!
Comment #10
ilaz CreditAttribution: ilaz at Balidea commentedI've just created a patch to be used in a continuos integration workflow with the 7.x-1.0-alpha1 version. It may be useful for you.
Comment #11
yemoko CreditAttribution: yemoko commentedHi,
The patch worked for me .
Thank you!