Closed (fixed)
Project:
Simplenews Scheduler
Version:
6.x-2.0-beta3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2011 at 15:35 UTC
Updated:
28 Jul 2011 at 18:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
data77 commentedComment #2
data77 commentedComment #3
data77 commentedsorry for all the title changes, too tired!
Comment #4
sgabe commentedI am afraid Simplenews 6.x-2.x is unsupported at the moment and this is a support request.
Comment #5
data77 commentedAny idea when 6.x-2.x will be supported? Have a client that needs this functionality and I want be able to tell them when they can have it.
Comment #6
sgabe commentedMaybe in february, but I have a few more important task to finish so I can't promise anything. Of course if someone would come along and provide a patch that could speed up the process.
Comment #7
bbence commentedThe main difference which prevents simplenews scheduler from functioning properly is that simplenews 2.x now adds its options for a newsletter node a separate tab instead of adding the form elements to the end of the node edit tab.
So this module tries to append it's settings to the node edit tab and also it tries to save it's settings when the node is updated.
I also needed a quick solution, so I had to end up "hacking" the saving part of this module into the simplenews module, but it works more or less.
Other change is to make the settings appear on the separate tab of simplenews 2.x.
1. modify simplenews_scheduler.module
In line 54-56 (function simplenews_scheduler_form_alter) should look like this:
global $user;
// Add schedule settings to the newsletter edit form.
if (isset($form['simplenews']) && user_access('send scheduled newsletters')) {
58-67:
// Set the default values.
$result = db_query("SELECT * FROM {simplenews_scheduler} WHERE nid = %d", arg(1));
$row = db_fetch_array($result);
if ($row) {
$scheduler = $row;
}
$form['simplenews']['send']['#options'][SIMPLENEWS_COMMAND_SEND_NONE] = t("Don't send now or stop sending");
2. Modify simplenews.module
After line 517:
(after the following block in function simplenews_node_tab_send_form_submit:
elseif ($values['simplenews']['send'] == SIMPLENEWS_COMMAND_SEND_TEST) {
// Send test newsletter to test address(es)
simplenews_send_test($node);
}
)
// ****************** SIMPLENEWS HACK FOR SCHEDULER ****************************
$send = $node->simplenews['send'];
$activated = $node->simplenews['activated'];
$interval = $node->simplenews['interval'];
$start_date = $node->simplenews['start_date'];
$stop = $node->simplenews['stop'];
$stop_date = $node->simplenews['stop_date'];
$stop_edition = $node->simplenews['stop_edition'];
// Change activation status if necessary.
switch ($send) {
case 0:
case 1:
$activated = 0;
break;
case 3:
$activated = 1;
break;
}
// Convert the user time back to GMT time and use that as our record.
$start_date = date_convert($start_date, DATE_DATETIME, DATE_UNIX, date_default_timezone_name());
$stop_date = date_convert($stop_date, DATE_DATETIME, DATE_UNIX, date_default_timezone_name());
if (!$node->is_edition) {
$result = db_query("INSERT INTO {simplenews_scheduler} (nid, activated, `interval`, start_date, stop, stop_date, stop_edition) VALUES (%d, %d, '%s', %d, %d, %d, %d)
ON DUPLICATE KEY UPDATE last_run = 0, activated = %d, `interval` = '%s', start_date = %d, stop = %d, stop_date = %d, stop_edition = %d",
$node->nid, $activated, $interval, $start_date, $stop, $stop_date, $stop_edition, $activated, $interval, $start_date, $stop, $stop_date, $stop_edition, $node->nid);
if (!$result) {
drupal_set_message(t('Saving or updating schedule settings for @title has been unsuccessful.', array('@title' => $node->title)), 'error');
}
}
// ********** SIMPLENEWS HACK FOR SCHEDULER ****************************
Again, it's a very dirty and very rough hack, but it can point to some places where this incompatibility can be resolved (i.e. overriding / hooking into the form validation for the simplenews module to make the saving also work as intended).
I'm no expert at creating patches, I only wanted to post this "solution" in case someone badly needs it like I did. :)
Comment #8
Mat77 commentedAny news?
Didn't try the hack in #7 yet, I'd rather use a "clean" solution if it exists.
Comment #9
data77 commentedAlso wondering if there's any progress for this issue...thanks in advance.
Comment #10
sgabe commented@bbence: Can you please provide a patch?
Comment #11
Mat77 commentedThe hack in #7 worked for me.
Would be great to update this module though...
Comment #12
dgtlmoon commentedSorry all, I need to spend some time on this soon :(
Comment #13
Onfire60 commentedHi All,
I have patched my files from the above example in #7 and will post them here. They work with Simplenews Scheduler 6.x-1.0-beta3 and Simplenews 6.x-2.0-alpha1. Hope this helps someone.
Comment #14
kirkcaraway commentedI tried this but couldn't get the scheduler to show up, so I had to revert back to Simplenews 1.x.
Comment #15
bmango commentedsubscribing
Comment #16
splash112 commentedsubscribe
Comment #17
dgtlmoon commentedTry the latest 6.x-2.x dev release
Comment #18
splash112 commentedThanks for the port!
Seems you forgot to add 'php_eval', array('type' => 'blob')) to the simplenews_scheduler_schema().
Use the Insert View module to insert some views to my Newsletter, nut somehow it seems that the View images will not display, even with the mime module enabled. Anybody got this working?- edit, sorry, worked as expected. Just not in my mail programs...
Thanks
Comment #19
PB1 commentedHello.
Thanks for the new version of Simplenews scheduler, dgtlmoon.
Simplenews Scheduler is now working for me again, using the following setup:
- SimpleNews 6.x-2.x-dev (2011-Jun-11)
- Simplenews Scheduler 6.x-2.0-beta3 (2011-May-31)
- Mime Mail 6.x-1.0-beta1 (2011-Jun-04)
This is running on:
- Drupal 6.22
- MySQL 5.1.49
- PHP 5.3.3
- Apache 2.2.13
- openSUSE 11.3
From my perspective, this issue has been addressed. I'm not sure about the issue raised by @splash112 in #18, though. I'm going ahead and setting this issue to R&TBTC.
Pete
Comment #20
dgtlmoon commentedJust waiting to resolve this possible bug with our SQL #970942: Saving or updating schedule settings for has been unsuccessful. before making a release, then we should be good to go, Please help test the patches on there, even if you are on MySQL.
Comment #21
sgabe commentedClosing this, we can continue in separate issues if anything comes up.