Ozzy47
Well-known member
So in XF 2.0 and 2.1 we could do something like this:
But now in 2.2 it throws an error, presumably due to thread types.
Error: Call to undefined method XF\Service\Thread\Creator::setPollCreator()
src/addons/Snog/Forms/Pub/Controller/Form.php:1619
So what do we need to do to resolve this?
PHP:
if ($params['create_poll'])
{
// CREATE PROMOTION POLL
if (!$params['form']->normalpoll && $params['form']->postpoll && $params['form']->pollquestion)
{
$pollCreator = $this->plugin('Snog\Forms:Poll')->setupPollCreate('thread', $creator->getThread(), $params['form'], 1);
$creator->setPollCreator($pollCreator);
}
// CREATE NORMAL POLL
if (!$params['form']->postpoll && $params['form']->normalpoll && $params['form']->normalquestion)
{
$pollCreator = $this->plugin('Snog\Forms:Poll')->setupPollCreate('thread', $creator->getThread(), $params['form'], 2);
$creator->setPollCreator($pollCreator);
}
}
But now in 2.2 it throws an error, presumably due to thread types.
Error: Call to undefined method XF\Service\Thread\Creator::setPollCreator()
src/addons/Snog/Forms/Pub/Controller/Form.php:1619
So what do we need to do to resolve this?