When I configure a subscription block and check the option "Display previous issues" and leave the number set to "5", I don't see any issues displayed in the block. Am I missing something?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Assigned: Unassigned » corvus_ch
corvus_ch’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
3.33 KB

Steps taken to reproduce this bug:

  • I used a clean Drupal installation with latest Simplenews from git repository.
  • Cretaion of a new newsletter category.
  • Creation of a new newsletter in this category.
  • Added block for the newsletter category to the layout.
  • Send the created newsletter.

As a result, the sent newsletter was listed as recent issue. For me, it is not possible to reproduce the described behaviour. To verify this in code, I wrote some tests.

@bjlewis2: If you still can't get it running, pleas provide more Information about your environment. What steps did you follow in order to ending up with the behaviour you described?

corvus_ch’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2
corvus_ch’s picture

#2: simplenews-1524530-2.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, simplenews-1524530-2.patch, failed testing.

corvus_ch’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs work » Needs review
corvus_ch’s picture

#2: simplenews-1524530-2.patch queued for re-testing.

bjlewis2’s picture

Status: Needs review » Closed (works as designed)

Well, I'll be... must have been a stupid mistake on my part. Maybe I had only sent a test message or something... I don't know, but it sure is working. Sorry for wasting your time! ;(

Berdir’s picture

Status: Closed (works as designed) » Needs review

Let's keep this at needs review, the patch adds test coverage for this which never hurts to have :)

Berdir’s picture

Status: Needs review » Needs work
+++ b/tests/simplenews.testundefined
@@ -1154,14 +1163,46 @@ class SimpleNewsAdministrationTestCase extends SimplenewsTestCase {
     $this->drupalLogin($admin_user);
+    ¶
+    $this->setupSubscriptionBlock($edit_category->tid, $settings = array(
+      'issue count' => 2,
+      'previous issues' => 1,

Trailing spaces here and at the bottom.

+++ b/tests/simplenews.testundefined
@@ -1154,14 +1163,46 @@ class SimpleNewsAdministrationTestCase extends SimplenewsTestCase {
+    $this->drupalGet('/');

/ is not necessary here, you can use an empty string.

+++ b/tests/simplenews.testundefined
@@ -1154,14 +1163,46 @@ class SimpleNewsAdministrationTestCase extends SimplenewsTestCase {
+    foreach ($displayed_issues as $name) {
+      $this->assertTrue(in_array((string)$name, $generated_names));

This does not verify that they are actually the two most recent issues, could also be any combination of them.

Instead, try to explicitly verify that $generated_names[1] and ..[2] are there and ...[0] is not.

corvus_ch’s picture

Status: Needs work » Needs review
FileSize
3.5 KB
Berdir’s picture

Status: Needs review » Fixed

Looks good, commited.

Berdir’s picture

Priority: Normal » Major
Status: Fixed » Needs work

This is currently causing test failures.

We need to ensure that the three newsletters are created with a correct created timestamp.

corvus_ch’s picture

Status: Needs work » Needs review
FileSize
842 bytes
Berdir’s picture

Status: Needs review » Fixed

Thanks, commited. Overlooked the missing space and had already pushed, so fixed that in a separate commit.

Status: Fixed » Closed (fixed)

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