Okay. This is what I do and get some results
Edit file -> ...\sys\Controller\Ajax\forum\topic.php
We need to find -> public function edit()
Then find a line -> $topic->updatePollIfExists($tid, $_POST['poll_title'], $_POST['poll_data'], $_POST['has_poll']);
and Add next code:
if ($_POST['has_poll'] == 'yes'
{
$topic->addPollToTopic($tid, $_POST['poll_title'], $_POST['poll_data']);
}
Now users can add a poll to old post and even Edit, but have errors like that when Edit:
As I understand that error means we dublicate our data twice.
I want to Add "IF / Else" to check If Poll Exists or Not Exist, but I can't do it myself
For example I need like that:
$topic->addPollToTopicIfNotExists($tid, $_POST['poll_title'], $_POST['poll_data']);
$topic->updatePollIfExists($tid, $_POST['poll_title'], $_POST['poll_data'], $_POST['has_poll']);
@admin help please. I don't want to wait for next release
[quote="pid:26137, uid:1"]This seems like a bug[/quote]
Okay. This is what I do and get some results
Edit file -> ...\sys\Controller\Ajax\forum\topic.php
We need to find -> **public function edit()**
Then find a line -> **$topic->updatePollIfExists($tid, $_POST['poll_title'], $_POST['poll_data'], $_POST['has_poll']);**
and Add next code:
if ($_POST['has_poll'] == 'yes') {
$topic->addPollToTopic($tid, $_POST['poll_title'], $_POST['poll_data']);
}
Now users can add a poll to old post and even Edit, but have errors like that when Edit:

As I understand that error means we dublicate our data twice.
I want to Add "IF / Else" to check If Poll Exists or Not Exist, but I can't do it myself(:|
For example I need like that::D
$topic->addPollToTopic**IfNotExists**($tid, $_POST['poll_title'], $_POST['poll_data']);
$topic->updatePollIfExists($tid, $_POST['poll_title'], $_POST['poll_data'], $_POST['has_poll']);
@admin help please. I don't want to wait for next release:S
edited Oct 25 '22 at 1:58 pm