Subscriber ID check missing in token generation

Created on 26 July 2024, 4 months ago

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].

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇩🇪Germany tgauges

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024