- Issue was unassigned.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
I think it makes more sense to allow a poll to be unpublished similar to a regular entity/node. A closed poll should still be accessible to show the results in many/most cases.
- 🇮🇳India samit.310@gmail.com
Hi @BramDriesen,
The
"published" = "status"
(entity_keys) is already exists as Active(A flag indicating whether the poll is active.) Field,this Active filed is used to open or close any poll, I guess we have to introduce new filed for open or close any poll, and will use this field to publish or unpublished any poll.
Please confirm.
Thanks
Samit K. - Assigned to BramDriesen
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Some extra things that came to mind:
- Needs update hook to update all existing polls to copy over the value from what is now published to the new Active field. Probably best to also set "published" to TRUE as default for now.
- Update view
- Update list builder - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Can already be tested. Only needs to add some tests for this.
- ivnish Kazakhstan
I tested it manually:
1) I created a new poll with anonymous votes. Poll is active and published.
2) Anonymous user can view poll and can vote
3) I set active=false, Anonymous user can view poll and can't vote
4) I set active=true and published=false
5) Anonymous user can't view pollIt works as expected.
But, after I set poll published=false, poll hide from Poll List Builder.
Proposed solution:
1) Allow to view unpublished polls into List Builder
2) We can also add new column "status" as Node List Builder with publishing status - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
The list builder I must admit I did not test yet! Thanks for the manual review :-) really helps
- ivnish Kazakhstan
@Bram, do you have time to continue this issue? It looks like 90% ready :)
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Poll list viewer seems to work fine.
Did notice in the listbuilder class that the votes section is not implemented. Will create a follow up issue for that.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Re #19: 📌 PollListBuilder is missing vote information Active
- ivnish Kazakhstan
Existing sites don't have new "status" field in /admin/content/poll, because they have "old" poll admin view. Should we add in hook_update re-import views.view.poll_admin.yml config form poll config/install directory?
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
That has crossed my mind as well. Not sure how to deal with that, as sites might have overwritten the view.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
I think a change records makes sense. Will draft it here: https://www.drupal.org/node/3479831 →
-
bramdriesen →
committed 8b8709f4 on 2.0.x
Issue #3045110 by bramdriesen, johnsicili, ivnish: Allow a poll to be...
-
bramdriesen →
committed 8b8709f4 on 2.0.x
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Also added the view related info in the CR.
Thanks for your reviews! @ivnish. Thanks to the rest that participated!
Automatically closed - issue fixed for 2 weeks with no activity.