Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order list view when using permissions #2222

Merged
merged 1 commit into from
May 25, 2021

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Apr 19, 2021

Fixes #2213

Reproduction:

  1. Create a new back end user group with all the necessary permissions to view Isotope orders.
  2. Only select Guests in Account manager » User groups » <group> » Isotope eCommerce » Allowed member group.
  3. Create a new non-admin back end user and assign this group.
  4. Log in as the new back end user and try to view the orders in the back end.

The following error will occur:

Doctrine\DBAL\Exception\SyntaxErrorException:
An exception occurred while executing 'SELECT id FROM tl_member WHERE':

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1

  at vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php:98
  at Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException()
     (vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php:182)
  at Doctrine\DBAL\DBALException::wrapException()
     (vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php:159)
  at Doctrine\DBAL\DBALException::driverExceptionDuringQuery()
     (vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:2121)
  at Doctrine\DBAL\Connection->handleExceptionDuringQuery()
     (vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php:1264)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor\contao\core-bundle\src\Resources\contao\library\Contao\Database\Statement.php:274)
  at Contao\Database\Statement->query()
     (vendor\contao\core-bundle\src\Resources\contao\library\Contao\Database\Statement.php:248)
  at Contao\Database\Statement->execute()
     (vendor\contao\core-bundle\src\Resources\contao\library\Contao\Database.php:194)
  at Contao\Database->execute()
     (vendor\isotope\isotope-core\system\modules\isotope\library\Isotope\Backend\ProductCollection\Callback.php:278)
  at Isotope\Backend\ProductCollection\Callback->checkPermission()
     (vendor\contao\core-bundle\src\Resources\contao\drivers\DC_Table.php:203)
  at Contao\DC_Table->__construct()
     (vendor\contao\core-bundle\src\Resources\contao\classes\Backend.php:411)
  at Contao\Backend->getBackendModule()
     (vendor\contao\core-bundle\src\Resources\contao\controllers\BackendMain.php:167)
  at Contao\BackendMain->run()
     (vendor\contao\core-bundle\src\Controller\BackendController.php:48)
  at Contao\CoreBundle\Controller\BackendController->mainAction()
     (vendor\symfony\http-kernel\HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor\symfony\http-kernel\HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor\symfony\http-kernel\Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (web\index.php:31)
  at require('web\\index.php')
     (web\app.php:4)              

This PR fixes that by implementing an additional check on whether the produced $arrLike array is empty, otherwise and invalid SQL query would be executed leading to this error.

@aschempp aschempp added the bug label Apr 21, 2021
@aschempp aschempp added this to the 2.7 milestone Apr 21, 2021
@aschempp aschempp modified the milestones: 2.7, 2.7.2 May 25, 2021
@aschempp aschempp merged commit 4a5e98f into isotope:2.7 May 25, 2021
@fritzmg fritzmg deleted the fix-order-list-when-using-permissions branch May 25, 2021 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CRITICAL ERROR after update to Isotope 2.7.0
2 participants