Open huseyinates opened 4 years ago
Hi there,
I've noticed the query has "ORDER BY b.sequence ORDER BY sequence asc'," => It is not allowed to have two "order by" after each other. Can you try removing or commenting this line https://github.com/friends-of-forkcms/fork-cms-module-banners/blob/master/src/Backend/Modules/Banners/Domain/Banner/BannerDataGrid.php#L21 then everything will work
Thanks, the problem has been fixed.
sorry i will disturb you again, My admin panel problem has been solved, I added and edited. I added the module to the frontend and I get the following error.
Type error: Argument 1 passed to Common\Locale::fromString() must be of the type string, null given, called in /home/wjango/domains/wjango.com/public_html/cms/src/Common/Doctrine/Type/LocaleType.php on line 29
Symfony\Component\Debug\Exception\ FatalThrowableError in src/Common/Locale.php (line 21) protected function __construct(string $locale) { $this->setLocale($locale); } public static function fromString(string $locale): self { return new static($locale); } abstract protected function getPossibleLanguages(): array; Locale::fromString(null) in src/Common/Doctrine/Type/LocaleType.php (line 29) LocaleType->convertToPHPValue(null, object(MySQL57Platform)) in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php (line 316) AbstractHydrator->gatherRowData(array('id_1' => '69440274-8b35-11ea-a0c5-960000406534', 'sequence_2' => '0', 'status_3' => 'active', 'image_4' => '5afc309dcde660070c25f002b1dc14bd29d89211.png', 'createdOn_5' => '2020-04-30 22:53:30', 'editedOn_6' => '2020-05-01 20:39:46', 'locale_8' => null, 'title_9' => null, 'subTitle_10' => null, 'linkToUrl_11' => null, 'bannerId_12' => null), array('r' => '|69440274-8b35-11ea-a0c5-960000406534', 'e0' => ''), array('r' => true)) in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php (line 331) ObjectHydrator->hydrateRowData(array('id_1' => '69440274-8b35-11ea-a0c5-960000406534', 'sequence_2' => '0', 'status_3' => 'active', 'image_4' => '5afc309dcde660070c25f002b1dc14bd29d89211.png', 'createdOn_5' => '2020-04-30 22:53:30', 'editedOn_6' => '2020-05-01 20:39:46', 'locale_8' => null, 'title_9' => null, 'subTitle_10' => null, 'linkToUrl_11' => null, 'bannerId_12' => null), array()) in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php (line 162) ObjectHydrator->hydrateAllData() in vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php (line 153) AbstractHydrator->hydrateAll(object(PDOStatement), object(ResultSetMapping), array('deferEagerLoad' => true)) in vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php (line 893) BasicEntityPersister->loadAll(array('status' => object(Status)), array('sequence' => 'ASC'), null, null) in vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php (line 178) EntityRepository->findBy(array('status' => object(Status)), array('sequence' => 'ASC')) in src/Backend/Modules/Banners/Domain/Banner/BannerRepository.php (line 22) BannerRepository->findAllActive() in src/Frontend/Modules/Banners/Widgets/Carousel.php (line 18) Carousel->execute() in src/Frontend/Core/Engine/Block/Widget.php (line 110) Widget->execute() in src/Frontend/Core/Engine/Page.php (line 367) Page->parseBlock(array('extra' => object(Widget)), array()) in src/Frontend/Core/Engine/Page.php (line 346) Page->parsePositions() in src/Frontend/Core/Engine/Page.php (line 199) Page->display() in src/Frontend/Core/Engine/Frontend.php (line 25) Frontend->display() in app/ForkController.php (line 106) ForkController->handleApplication(object(Frontend)) in app/ForkController.php (line 80) ForkController->frontendController() in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151) HttpKernel->handleRaw(object(Request), 1) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68) HttpKernel->handle(object(Request), 1, true) in app/Kernel.php (line 53) Kernel->handle(object(Request)) in /index.php (line 59)
Hi, Module setup successful I added a banner and page failed. I can't log back into the module
Thanks
Error message; SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY sequence asc' at line 6
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY sequence asc' at line 6
at vendor/spoon/library/spoon/database/database.php:662 at PDOStatement->execute() (vendor/spoon/library/spoon/database/database.php:662) at SpoonDatabase->getRecords('SELECT b.id, b.sequence, bt.title FROM Banner b INNER JOIN BannerTranslation bt WHERE bt.locale = :locale AND bt.bannerId = b.id GROUP BY b.id ORDER BY b.sequence ORDER BY sequence asc', array('locale' => object(Locale))) (vendor/spoon/library/spoon/datagrid/source_db.php:139) at SpoonDatagridSourceDB->getData(null, null, 'sequence', 'asc') (vendor/spoon/library/spoon/datagrid/datagrid.php:743) at SpoonDataGrid->parse() (vendor/spoon/library/spoon/datagrid/datagrid.php:505) at SpoonDataGrid->getContent() (src/Backend/Core/Engine/DataGrid.php:344) at Backend\Core\Engine\DataGrid->getContent() (src/Backend/Modules/Banners/Domain/Banner/BannerDataGrid.php:40) at Backend\Modules\Banners\Domain\Banner\BannerDataGrid::getHtml() (src/Backend/Modules/Banners/Actions/BannerIndex.php:14) at Backend\Modules\Banners\Actions\BannerIndex->execute() (src/Backend/Core/Engine/Action.php:63) at Backend\Core\Engine\Action->execute() (src/Backend/Core/Engine/Backend.php:25) at Backend\Core\Engine\Backend->display() (app/ForkController.php:106) at ForkCMS\App\ForkController->handleApplication(object(Backend)) (app/ForkController.php:54) at ForkCMS\App\ForkController->backendController() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (app/Kernel.php:53) at ForkCMS\App\Kernel->handle(object(Request)) (index.php:59)