From 0fd0e336a0d2d267a3a6851dff796064411a60ee Mon Sep 17 00:00:00 2001 From: Lastorder <18280396+Lastorder-DC@users.noreply.github.com> Date: Fri, 22 Nov 2024 09:40:10 +0900 Subject: [PATCH] TEMP: allow one option --- modules/editor/components/poll_maker/tpl/popup.js | 2 +- modules/poll/poll.controller.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/editor/components/poll_maker/tpl/popup.js b/modules/editor/components/poll_maker/tpl/popup.js index c2f58afdc..3e4e00ca0 100644 --- a/modules/editor/components/poll_maker/tpl/popup.js +++ b/modules/editor/components/poll_maker/tpl/popup.js @@ -70,7 +70,7 @@ jQuery(function($){ $tr = $(this).prevAll('div').children('table').find('>tbody>tr:last'); match = $tr.find('td>input').attr('name').match(/item_(\d+)_(\d+)/); - if(!match) return; + if(!match || match[2] == 1) return; $tr.remove(); diff --git a/modules/poll/poll.controller.php b/modules/poll/poll.controller.php index 4fb539a23..eb3499e0b 100644 --- a/modules/poll/poll.controller.php +++ b/modules/poll/poll.controller.php @@ -100,8 +100,7 @@ class PollController extends Poll } } - // TEMP: allow empty poll if add item is on - if((!isset($args->poll) || !is_array($args->poll) || !count($args->poll)) && $vars->add_item != '2') + if(!isset($args->poll) || !is_array($args->poll) || !count($args->poll)) { throw new Rhymix\Framework\Exception('cmd_null_item'); }