forked from GNUsocial/gnu-social
[Poll] Fixed ShowPoll route, moved Poll Entity, created NewPollForm
Entity was temporarily moved to src/Entity in order to load from DB, since it is yet no possible to do that from Plugin
This commit is contained in:
@@ -21,11 +21,23 @@
|
||||
|
||||
namespace Plugin\PollPlugin\Controller;
|
||||
|
||||
use App\Entity\Poll;
|
||||
use App\Util\Common;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class ShowPoll
|
||||
{
|
||||
public function showpoll(Request $request)
|
||||
public function showpoll(Request $request, string $id)
|
||||
{
|
||||
$user = Common::ensureLoggedIn();
|
||||
|
||||
$poll = Poll::getFromId((int) $id);
|
||||
//var_dump($poll);
|
||||
|
||||
if ($poll == null) {//|| !$poll->isVisibleTo($user)) { todo
|
||||
throw new NoSuchPollException(); //?
|
||||
}
|
||||
|
||||
return ['_template' => 'base.html.twig'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user