Polls by FriendsOfFlarum

License Latest Stable Version Downloads OpenCollective Patreon

Extiverse

A Flarum extension that adds polls to your discussions. This is a rewrite of most of the internals of reflar/polls, which should fix all the issues people were having with it.

Installation

composer require fof/polls

Migrating from ReFlar Polls

Make sure you've updated to the latest reflar/polls version and run php flarum migrate BEFORE installing fof/polls.
You will not be able to install this extension if you have a version of ReFlar Polls older than v1.3.4 as well.

$ composer require reflar/polls
$ php flarum migrate
$ composer require fof/polls

Updating

composer update fof/polls

Metadata update

To improve performance, Polls calculates and stores the number of votes when it changes.

As long as the extension is active, Polls will automatically keep those numbers up to date and you don't need to do anything.

If you are updating from a version prior to 0.3.3, if you disabled the extension for a while or if you made manual changes to the database you should run the following command to refresh the numbers:

php flarum fof:polls:refresh

You can only run the command when the extension is enabled in the admin panel.

Links

OpenCollective GitHub

An extension by FriendsOfFlarum.

    • [deleted]

    Despite following the steps listed here, I get the below error message in the log

    [2019-07-04 12:25:14] production.ERROR: UnexpectedValueException: [fof/polls] Please run the latest migration(s) of reflar/polls before enabling this extension. in /home/inoculrn/discuss.guruwall.com/vendor/fof/polls/src/Migrations/AbstractMigration.php:36

      • [deleted]

      Ok, fixed the first part, and now have the below

      [2019-07-04 12:31:03] production.ERROR: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (inoculrn_phenomlab.#sql-1c30_1621e3, CONSTRAINTpolls_discussion_id_foreignFOREIGN KEY (discussion_id) REFERENCESdiscussions(id) ON DELETE CASCADE) in /home/inoculrn/discuss.guruwall.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117

        [deleted] Does that error occur when trying to enable the extension ? If so, it might be an issue with one of the discussions being deleted that kept the discussion id in the DB 🤔.

          • [deleted]

          datitisev Any way around this issue ? I can't enable the extension currently.

            0.1.1

            • Updated migrations to fix issues when migrating from reflar/polls
              • Delete polls whose discussions no longer exist
              • Set poll user ids to null if the user no longer exists
              • Delete poll options whose poll no longer exist
              • Delete poll votes whose user or poll no longer exist

            Updating

            composer update fof/polls

            tolgaaaltas I think I made a mistake when rewriting this, because right now you can only vote by clicking the checkbox.

            Though if that is not what you are talking about, can you elaborate on your issue ?

              datitisev It's not the problem for me. When i click checkbox, i got this error message on board: The requested resource could not be found.*
              *Translated from Turkish

                tolgaaaltas Hm, that could be caused by another extension. Do you have flagrow/split installed ? If not, could you post the output of php flarum info ?

                  5 days later

                  Does this plug-in support voting posts with pictures?