Closed (duplicate)
Project:
Simplenews
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2022 at 17:36 UTC
Updated:
31 Jul 2023 at 15:49 UTC
Jump to comment: Most recent
If an issue is sent to SIMPLENEWS_STATUS_SEND_PUBLISH the 'Stop sending' button will show on NodeTabForm but have no effect.
NodeTabForm:
public function buildForm() {
...
if ($status != SIMPLENEWS_STATUS_SEND_READY) {
...
$form['actions']['stop'] = [
'#type' => 'submit',
'#submit' => ['::submitStop'],
'#value' => $this->t('Stop sending'),
];
}
public function submitStop(array &$form, FormStateInterface $form_state) {
$this->spoolStorage->deleteIssue($form_state->get('node'));
}SpoolStorage:
public function addIssue(ContentEntityInterface $issue) {
if (!in_array($issue->simplenews_issue->status, [SIMPLENEWS_STATUS_SEND_NOT, SIMPLENEWS_STATUS_SEND_PUBLISH])) {
return;
}
In submitStop() change the status to SEND_NOT if it is SEND_PUBLISH.
None.
None.
None.
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
jonathanshawComment #4
jonathanshawI can't see why the test I added is failing. All lookgs good to me.
Comment #5
adamps commentedShame - this was stuck in Needs work so I didn't look at it.
Any it was fixed in a slightly different way in #3341062: "Stop Sending" not working when unpublished.