Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
When this issue #2648802: Deleting a choice should delete the votes over it in the database will be fixed, deleting a choice will delete all the votes over it, so we must alert the user in case this choice has votes on it (or maybe just put a general alert, to be discussed).
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff-alert_the_user_that-2648836-4-7.txt | 4.02 KB | edurenye |
#7 | alert_the_user_that-2648836-7.patch | 4.42 KB | edurenye |
#4 | alert_the_user_that-2648836-3.patch | 1.89 KB | edurenye |
| |||
#3 | alert_the_user_that-2648836-3.png | 22.85 KB | edurenye |
Comments
Comment #2
Bambell CreditAttribution: Bambell at MD Systems GmbH commentedComment #3
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedFinally I found how to do that.
This is how it looks like:
Comment #4
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedMissed the patch, sorry.
Comment #5
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedI think we need JS tests for that, so postponed until #2610150: Readd tests for Ajax Poll Vote is in.
Comment #6
BerdirThat is in, lets add test for this now.
typo: Waring.
lets give the file and library a better name. admin/poll_admin.js maybe. Or more specific to what we are doing.
We control the widget. Might be easier to just add it there?
For the next time, look into Element::children(), then you don't need the is_int() check.
Comment #7
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedDid those changes and started with tests, the problem is when I do $this->assertFalse($page->hasContent()), I want to check that there is no content, but it gets stuck there, not sure if there is another way to do it, I'm using it wrong or is a issue with mink or with core.
I upload it, maybe somebody else find a way to fix this test.
Comment #8
edurenye CreditAttribution: edurenye at MD Systems GmbH commentedLocally the test was failing.
Comment #10
BerdirWorks fine for me as well and fails as a test-only. Committed.
Comment #11
BerdirActually, looks like it only works most of the time with PHP 7 (but not always).
Reverted.
Comment #15
BerdirApparently this is failing somewhat randomly. Decided to commit the patch without test and opened #2736863: Add tests: Alert the user that deleting a choice will delete the votes on it to investigate and fix the test.