- Pass the template_node as second argument to it.
- Rename to hook_simplenews_scheduler_edition_node_alter().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
1.66 KB

Did that.

joachim’s picture

Status: Needs review » Needs work
+++ b/simplenews_scheduler.api.php
@@ -12,7 +12,12 @@
+function hook_simplenews_scheduler_edition_node_alter($node, $scheduler_node) {

+++ b/simplenews_scheduler.module
@@ -679,9 +679,9 @@ function _simplenews_scheduler_new_edition($nid, $edition_time) {
+  drupal_alter('simplenews_scheduler_edition_node', $edition_node);

The two function signatures don't seem to match?

Berdir’s picture

Status: Needs work » Needs review

Ups.

They are named differently, I think scheduler_node makes more sense, not sure if we should update the clone function.

Berdir’s picture

Forgot the patch.

joachim’s picture

Status: Needs review » Fixed

Let's call it $edition_node throughout. Committed the patch with this tweak.

- #1476744 by Berdir: Changed the edition alter hook name and added a parameter for the template scheduler node.

joachim’s picture

Version: 7.x-1.x-dev » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)

Since the original version of this hook was backported to D6, so should this change to it.

joachim’s picture

*sigh*... except that getting hold of the template node in _simplenews_scheduler_new_edition() is going to require major rewriting of that function and testing to work with node cloning issues etc etc. Not sure it's worth it :/

joachim’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Patch (to be ported) » Fixed

We should change the hook name for consistency and easier upgrading though: #1567442: backport change of name of edition alter hook.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.