ReFlar / polls

[ABANDONED] See https://github.com/FriendsOfFlarum/polls
MIT License
14 stars 14 forks source link

Poll Answer # does not reset when adding or removing additional poll options #33

Closed Ralkage closed 6 years ago

Ralkage commented 6 years ago

Description

When you create or start a poll from the "Start Discussion" composer, the poll option number does not reset back to it's original number when you remove a 3rd option and add a new one back in. In this state, you also cannot submit the poll to attach to the discussion.

Steps to Reproduce

  1. Start a discussion.
  2. Add a poll.
  3. Add an option passed the default 2.
  4. Delete that option.
  5. Try adding another option again.
  6. Take note as the answer # increases even after you deleted/removed the previous one.

Expected Behavior: When you launch the poll modal and want to add more options, you should be allowed to remove an option and add more options without the "Answer #" increasing instead of it being the actual field option number.

Actual Behavior: Poll options do not reset back to their original "Answer #" and the number just increases instead. In this state, you also cannot submit the poll as clicking the "Submit" button does not close the "Add Poll" modal.

Add Poll

Flarum/Server/Client Information

Technical Details

Flarum Info

Flarum core 0.1.0-beta.7
PHP 7.0.28-0ubuntu0.16.04.1
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, session, standard, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imap, json, exif, mysqli, pdo_mysql, pdo_sqlite, Phar, posix, readline, shmop, SimpleXML, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, Zend OPcache
EXT flarum-approval v0.1.0-beta.7
EXT flarum-bbcode v0.1.0-beta.5
EXT flarum-emoji v0.1.0-beta.6
EXT flarum-english v0.1.0-beta.7
EXT flagrow-bazaar 0.2.4
EXT flarum-flags v0.1.0-beta.7
EXT flarum-likes v0.1.0-beta.6
EXT flarum-lock v0.1.0-beta.7
EXT flarum-markdown v0.1.0-beta.5
EXT flarum-mentions v0.1.0-beta.7
EXT reflar-polls 1.2.2
EXT flarum-sticky v0.1.0-beta.7
EXT flarum-subscriptions v0.1.0-beta.6
EXT flarum-suspend v0.1.0-beta.7
EXT flarum-tags v0.1.0-beta.8
Base URL: https://reflar.redevs.org/demo
Installation path: Omitted due to security issues.

Log Files

N/A