Problem/Motivation

When searching the polls on /admin/content/poll and applying the status to inactive, it still shows the active polls.

Proposed resolution

Filter out the active polls when searching for inactive polls, the bug should be fixed in the view data.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#36 poll-active_condition_not_working-2774641-36.patch1.54 KBmqanneh
#35 poll-active_condition_not_working-2774641-35.patch1.77 KBmqanneh
#17 active_condition-2774641-17-test_only.patch928 bytesModernMantra
#17 active_condition-2774641-17.patch3.1 KBModernMantra
#17 interdiff-14-17.txt781 bytesModernMantra
active-bug.png12.5 KBGinovski
#2 active_condition-2774641-2.patch1.52 KBModernMantra
#4 active_condition-2774641-4.patch2.2 KBModernMantra
#6 interdiff-4-6.txt2.99 KBModernMantra
#6 test_support_for_patch-2774641-6.patch815 bytesModernMantra
#10 active_condition-2774641-10.patch2.99 KBModernMantra
#10 active_condition-2774641-10-test_only.patch815 bytesModernMantra
#14 interdiff-10-14.txt1.01 KBModernMantra
#14 active_condition-2774641-14.patch3.08 KBModernMantra
#14 active_condition-2774641-14-test_only.patch904 bytesModernMantra
#20 active_condition-2774641-20.patch2.93 KBModernMantra
#20 active_condition-2774641-20-test_only.patch749 bytesModernMantra
#20 interdiff-17-20.txt498 bytesModernMantra
#28 active_condition-2774641-28.patch2.98 KBModernMantra
#28 active_condition-2774641-28-test_only.patch749 bytesModernMantra
#28 interdiff-2774641-20-28.txt367 bytesModernMantra
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ginovski created an issue. See original summary.

ModernMantra’s picture

Assigned: Unassigned » ModernMantra
Status: Active » Needs review
FileSize
1.52 KB

Possible fix for an issue

Status: Needs review » Needs work

The last submitted patch, 2: active_condition-2774641-2.patch, failed testing.

ModernMantra’s picture

Status: Needs work » Needs review
FileSize
2.2 KB

New patch that fixes the issue

johnchque’s picture

Status: Needs review » Needs work

Looks nice, can we get some test coverage? Should just need to extend an existing one.

ModernMantra’s picture

Added test support for bug fix

ModernMantra’s picture

Status: Needs work » Needs review

Forgot to change status to needs review

Status: Needs review » Needs work

The last submitted patch, 6: test_support_for_patch-2774641-6.patch, failed testing.

Bambell’s picture

Ho, we need a combined patch (fix and test).

ModernMantra’s picture

Adding test only patch and combined one

Status: Needs review » Needs work

The last submitted patch, 10: active_condition-2774641-10-test_only.patch, failed testing.

tduong’s picture

Status: Needs work » Needs review

Yep, now it is correct, only remember to switch the uploading patch order next time :)

johnchque’s picture

Status: Needs review » Needs work
+++ b/src/Tests/PollCreateTest.php
@@ -25,7 +25,9 @@ class PollCreateTest extends PollTestBase {
+    $this->drupalGet('admin/content/poll', ['query' => ['status' => '2']]);
+    $this->drupalGet('admin/content/poll', ['query' => ['question' => '', 'status' => '2']]);

We shouldn't need both, can you try just using the first one?

+++ b/src/Tests/PollCreateTest.php
@@ -25,7 +25,9 @@ class PollCreateTest extends PollTestBase {
-

We need to separate this block of code with a white line. Can you also add a comment about what we are testing here?

ModernMantra’s picture

Fix of small errors stated in comment #13

The last submitted patch, 14: active_condition-2774641-14-test_only.patch, failed testing.

johnchque’s picture

Status: Needs review » Needs work
+++ b/src/Tests/PollCreateTest.php
@@ -26,9 +26,13 @@ class PollCreateTest extends PollTestBase {
+    $this->assertNoText($poll->label(), 'Poll ');

This one should say: 'Poll does not appear in poll list.'

+++ b/src/Tests/PollCreateTest.php
@@ -26,9 +26,13 @@ class PollCreateTest extends PollTestBase {
-    $this->assertText($poll->label(), 'Poll appears in poll list.');
+    $this->assertText($poll->label(), 'Poll does not appear in the poll list.');

Then this one should remain as 'Poll appears in poll list.'

ModernMantra’s picture

Fixed issues from previous comment

The last submitted patch, 17: active_condition-2774641-17-test_only.patch, failed testing.

johnchque’s picture

Status: Needs review » Needs work
+++ b/src/Tests/PollCreateTest.php
@@ -26,9 +26,13 @@ class PollCreateTest extends PollTestBase {
-    $this->assertText($poll->label(), 'Poll appears in poll list.');
+    $this->assertText($poll->label(), 'Poll appears in the Poll List.');

This is an unrelated change. Just keep the text.

ModernMantra’s picture

New fix that corrects issue in comment #19

Status: Needs review » Needs work

The last submitted patch, 20: active_condition-2774641-20-test_only.patch, failed testing.

tduong’s picture

Status: Needs work » Needs review

Please, remember to upload first the test_only patch and then the combined patch so testbot runs first the first patch and after the second one that should pass, the issue status is set as "Needs review" and you don't have to care about the status anymore ;)

ModernMantra’s picture

I was really looking for order i put my files, however it have flipped them. Sorry for making issue again.

tduong’s picture

Status: Needs review » Needs work
+++ b/src/Tests/PollCreateTest.php
@@ -26,6 +26,10 @@ class PollCreateTest extends PollTestBase {
+    $this->assertNoText($poll->label(), 'Poll does not appear in the Poll List');

It looks like your interdiff is not referring to your current patch ?

tduong’s picture

Status: Needs work » Needs review

Sorry, misunderstood, my bad ^^'
Then I think it's alright :P

johnchque’s picture

Status: Needs review » Reviewed & tested by the community

Looks good! I would say that this is ready.

Berdir’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/config/install/views.view.poll_admin.yml
@@ -4,8 +4,6 @@ dependencies:
     - user
-_core:
-  default_config_hash: sQtV9H9fDwGnxt2jTA27cAL9fT_hYWEtExVK6etjQKM
 id: poll_admin
 label: 'Poll admin'

this should not be removed, it will change, that is ok.

If it didn't generate that, then that is because you were on an old core version.

ModernMantra’s picture

Fixed issue that 'core element' was removed due to old core version.

The last submitted patch, 28: active_condition-2774641-28-test_only.patch, failed testing.

tduong’s picture

Status: Needs review » Reviewed & tested by the community

Nice, now it looks alright! :)

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Agreed.

  • Berdir committed 549a786 on 8.x-1.x authored by ModernMantra
    Issue #2774641 by ModernMantra, Ginovski: Active condition not working
    

Status: Fixed » Closed (fixed)

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

mqanneh’s picture

Assigned: ModernMantra » mqanneh

Still not working even after updating the module to the latest dev version.

mqanneh’s picture

The applied patch fixed one part of the issue but not the second part. when you filter for "Active: No" the non active polls won't appear in the results and you will get empty view instead.

I removed the unused group, and assigned the active options "Yes and No" to have associated boolean values.

mqanneh’s picture

FileSize
1.54 KB