"Send test newsletter issue" fails if testing with a non-subscriber email

Created on 20 August 2024, 3 months ago
Updated 2 September 2024, 3 months ago

Problem/Motivation

As a content manager I want to test how the newsletter issue looks like on email. I want to use the node/{nid}/simplenews "Test" functionality

Steps to reproduce

* Create newsletter issue
* Click "Newsletter" tab
* Enter "Test email addresses" an email address that is not one of subscribers
* Click "Send test newsletter issue"

Yields following error due to snid is NULL.

Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "snid" for route "simplenews.newsletter_subscriptions_arguments" 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

Fix the code, set numeric value for snid if it's NULL on manage-url token case.

The subscriber-id can probably be anything, like 0 because when testing the email can be someone else than real subscriber.

Remaining tasks

Patch

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Closed: cannot reproduce

Version

3.0

Component

Code

Created by

🇫🇮Finland kirkkala Helsinki

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

Comments & Activities

Production build 0.71.5 2024