I installed simplenews scheduler today and whenever I try to create a scheduled newsletter, I keep getting this error message. "Saving or updating schedule settings for "newsletter name" has been unsuccessful."
Can someone point me to a solution for this issue please
I am on the latest drupal 6 release.
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | simplenews_scheduler.patch | 17.85 KB | dgtlmoon |
| #30 | simplenews_scheduler-pgsql_2_3.patch | 12.91 KB | dgtlmoon |
| #29 | simplenews_scheduler-pgsql_2_2.patch | 12.53 KB | dgtlmoon |
| #27 | simplenews_scheduler-pgsql_2_1.patch | 12.37 KB | dgtlmoon |
| #25 | simplenews_scheduler-pgsql_2.patch | 12.34 KB | dgtlmoon |
Comments
Comment #1
sgabe commentedCan you provide more details on how to reproduce?
Comment #2
dgtlmoon commentedYeah let us know if theres something we can do to reproduce, or try the 2.x branch with simplenews 6.x-2.x
Comment #3
dgtlmoon commentedComment #4
Anonymous (not verified) commentedI have the same issue, using simplenews 2.x and simplenews scheduler 2.x
The error message is
* warning: pg_query(): Query failed: ERROR: syntax error at or near "`" LINE 1: ...INTO drupal_simplenews_scheduler (nid, activated, `interval`... ^ in /home/www/www.habeas.com.pt/drupal/includes/database.pgsql.inc on line 138.
* user warning: query: INSERT INTO drupal_simplenews_scheduler (nid, activated, `interval`, start_date, stop, stop_date, stop_edition, php_eval ) VALUES (196, 0, 'day', 1307107080, 0, 1388447940, 0, '') ON DUPLICATE KEY UPDATE last_run = 0, activated = 0, `interval` = 'day', start_date = 1307107080, stop = 0, stop_date = 1388447940, stop_edition = 0, php_eval = '' in /home/www/www.habeas.com.pt/drupal/sites/all/modules/simplenews_scheduler/simplene... on line 153.
* Saving or updating schedule settings for teste has been unsuccessful.
Comment #5
Anonymous (not verified) commentedany quick and dirt fix for this issue?
Comment #6
dgtlmoon commented@lutra -> Are you still getting this problem on latest dev?
Comment #7
Anonymous (not verified) commentedyes, I'm using 6.x-2.0-beta3 with simplenews 6.x-2.0-alpha2
PS
How I get notifications of answers in this ticket? Sorry I'm not yet comfortable with the Drupal tracker.
Comment #8
dgtlmoon commentedNo idea sorry
Comment #9
Anonymous (not verified) commentedHi,
no idea about the notifications or about the bug? :)
Comment #10
Azol commented"Quick and dirty" fix for this issue is as follows (only if you are on MySQL):
change all instances of interval and stop in a query with corresponding simplenews_scheduler.interval and simplenews_scheduler.stop prefixed ones, because INTERVAL and STOP are actual SQL commands.
So the query beginning on line 161 of simplenews_scheduler.module should read:
Hopefully someone will be able to create corresponding patch quick, marking this as Needs work meanwhile.
Comment #11
Azol commentedComment #12
Anonymous (not verified) commentedHi, thanks for the patch.
after applying it I get
* warning: pg_query(): Query failed: ERROR: syntax error at or near "ON" LINE 3: ON DUPLICATE KEY UPDATE last_ru... ^ in /home/www/www.habeas.com.pt/drupal/includes/database.pgsql.inc on line 138.
* user warning: query: INSERT INTO drupal_simplenews_scheduler (nid, activated, simplenews_scheduler.interval, start_date, simplenews_scheduler.stop, stop_date, stop_edition, php_eval) VALUES (220, 1, 'month', 1308416220, 2, 1388447940, 1, '') ON DUPLICATE KEY UPDATE last_run = 0, activated = 1, simplenews_scheduler.interval = 'month', start_date = 1308416220, simplenews_scheduler.stop = 2, stop_date = 1388447940, stop_edition = 1, php_eval = '' in /home/www/www.habeas.com.pt/drupal/sites/all/modules/simplenews_scheduler/simplene... on line 152.
* Saving or updating schedule settings for teste has been unsuccessful.
Comment #13
Azol commentedI guess the problem is you are using PostgreSQL and I am using MySQL. I am not too good at DB syntax differences, but the problem here is that PostgreSQL does not support ON DUPLICATE KEY construction. The query this module uses is pure MySQL syntax.
Comment #14
dgtlmoon commentedYes, well I guess either way we need to change those fields.
Comment #15
dgtlmoon commentedOK I have created two patches
One addresses the bad SQL directly and the other is a general cleanup (uses isset() etc).
It also includes an update hook to attempt to rename the tables.
update: don't use these patches
Comment #16
Azol commentedJust a quick notice on the pgsql patch:
Does this really needs a $nid at the very end of the line? I believe it's superfluous, since the last modifier used in query is php_eval='%s'
And yeah, it's not going to work on PostgreSQL due to ON DUPLICATE KEY mentioned above.
Comment #17
dgtlmoon commentedYeah I don't know who added that DUPLICATE KEY business, heres an improved patch..
Comment #18
Azol commentedThese two patches ("improved sql" and "notify cleans") are contradicting each other - you cannot apply them one after another because each patch messes with part of the code the other patch refers to.
Could you possibly combine them into one patch so we can start testing?
Comment #19
Azol commentedoops
Comment #20
dgtlmoon commentedPlease just use the patch in #17 I will rework the other patch once this issue is clearedcleared
Comment #21
Anonymous (not verified) commentedTo what version of the module the patch applies? I'm having problems to apply it to both the beta and dev verions (6.x-2)
Comment #22
Azol commentedLast dev. version works ok. Use only patch from #17
Comment #23
Azol commentedOh, I can see your problem - the patch that dgtlmoon has provided is not a "fair" patch (I won't tell you why :)
Just use the one I attached here.
Comment #24
Anonymous (not verified) commentedThanks for the reviewed patch, it applies correctly.
Now the problem comes when cron runs (after having scheduled the day/hour when to send the newsletter), the error message I see is
* warning: pg_query(): Query failed: ERROR: column "full html" does not exist LINE 1: ...format FROM drupal_filter_formats WHERE name like "full html... ^ in /home/www/www.habeas.com.pt/drupal/includes/database.pgsql.inc on line 138.
* user warning: query: SELECT format FROM drupal_filter_formats WHERE name like "full html" in /home/www/www.habeas.com.pt/drupal/sites/all/modules/simplenews_scheduler/simplene... on line 344.
and the newsletter is not sent. Thanks in advance again.
Comment #25
dgtlmoon commentedTry against latest dev, as I've also commited #1192670: 6.x-2.x HTML mail not sent which may help postgres users
Used the Drupal API for finding the "Full HTML" format instead of the silly SQL statement. (It needs to find the full html output filter to set the generated editions to, as they are static)
Comment #26
Azol commentedTo lutra: replace "a/simplenews" occurences with "simplenews" and "b/simplenews" with "simplenews" in this patch to apply correctly :)
Comment #27
dgtlmoon commentedFound another glitch... which i hope is the last
Seems to be triggering when sending newsletters.
fixed with
Also, noticed that if you hit cron.php as a authenticated user, it does not unset your $user, so your newsletters can include [edit] etc
Comment #28
miro_dietikerNote that arg(0)=='node' is also valid for test sending a newsletter...
Comment #29
dgtlmoon commentedOK, well i'm leaving that part out until we figure out a nicer way in the UI to show that you are viewing a generated newsletter and not the original.
Comment #30
dgtlmoon commentedSorry, and this one actually implements the improved function for figuring out the input types instead of the bogus SQL
this contains...
test against this patch.
Comment #31
dgtlmoon commentedThis also takes care of lots of warnings if you have your PHP configured to return all notices/warnings for unset variables etc.
Comment #32
goleyasss commentedSimplenews Schuduler is adding stuff to new created editions of newsletters and shown on my home page when a user want to
enter the site.How can I delete this edition?
Comment #33
dgtlmoon commentedthat's just how it works, it schedules a new copy of the newsletter to be created - also please post a support issue, not in this thread
Comment #34
dgtlmoon commentedcommitted
Comment #35
dgtlmoon commentedHave done a lot of my own testing and seems to work nicely
Comment #36
miro_dietikerCool. Great to see this fixed.