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].
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3463997_add-checks_against-4.0.0.patch | 1.03 KB | tgauges |
Issue fork simplenews-3463997
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
Comment #3
tgaugesHere is a patch against 4.0.0 for reproducible builds.
Comment #4
adamps commentedThanks.
I made one comment in the MR.
Comment #5
tgaugesI forgot to put this issue back into "needs review", please take a look at my response in the MR.
Comment #6
adamps commentedThanks I answered the question
Comment #7
tgaugesComment #9
adamps commentedGreat thanks