Problem/Motivation

The function simplenews_generate_url does not work for unsaved subscribers because those entities do not have an ID. The ID is needed as parameter for the route.

Steps to reproduce

Try to send a newsletter test with a [simplenews-subscriber:manage-url] token to an email which does not already exist as subscriber.

You will get the following error: Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "snid" for route "simplenews.subscriptions_manage" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 209 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Proposed resolution

Check the subscriber ID for the tokens [simplenews-subscriber:confirm-url] and [simplenews-subscriber:manage-url] just as it is done for [simplenews-subscriber:unsubscribe-url].

CommentFileSizeAuthor
#3 3463997_add-checks_against-4.0.0.patch1.03 KBtgauges

Issue fork simplenews-3463997

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tgauges created an issue. See original summary.

tgauges’s picture

Assigned: tgauges » Unassigned
Status: Active » Needs review
StatusFileSize
new1.03 KB

Here is a patch against 4.0.0 for reproducible builds.

adamps’s picture

Status: Needs review » Needs work

Thanks.

I made one comment in the MR.

tgauges’s picture

Status: Needs work » Needs review

I forgot to put this issue back into "needs review", please take a look at my response in the MR.

adamps’s picture

Status: Needs review » Needs work

Thanks I answered the question

tgauges’s picture

Status: Needs work » Needs review

  • adamps committed 9de06bcc on 4.x authored by tgauges
    Issue #3463997 by tgauges, adamps: Subscriber ID check missing in token...
adamps’s picture

Status: Needs review » Fixed

Great thanks

Status: Fixed » Closed (fixed)

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