martin-georgiev / postgresql-for-doctrine

PostgreSQL enhancements for Doctrine. Provides support for advanced data types (json, jssnb, arrays), text search, array operators and jsonb specific functions.
https://packagist.org/packages/martin-georgiev/postgresql-for-doctrine
MIT License
362 stars 44 forks source link

Cannot use object of type Doctrine\Common\Lexer\Token as array #181

Open pesseyjulien opened 9 months ago

pesseyjulien commented 9 months ago

Hi,

Juste upgraded to 8.3 and the UNACCENT function throws an error :

Error:
Cannot use object of type Doctrine\Common\Lexer\Token as array

  at vendor/martin-georgiev/postgresql-for-doctrine/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseVariadicFunction.php:24
  at MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseVariadicFunction->feedParserWithNodes(object(Parser))
     (vendor/martin-georgiev/postgresql-for-doctrine/src/MartinGeorgiev/Doctrine/ORM/Query/AST/Functions/BaseFunction.php:50)
  at MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseFunction->parse(object(Parser))
     (vendor/doctrine/orm/src/Query/Parser.php:3662)
  at Doctrine\ORM\Query\Parser->CustomFunctionsReturningStrings()
     (vendor/doctrine/orm/src/Query/Parser.php:3526)
  at Doctrine\ORM\Query\Parser->CustomFunctionDeclaration()
     (vendor/doctrine/orm/src/Query/Parser.php:3491)
  at Doctrine\ORM\Query\Parser->FunctionDeclaration()
     (vendor/doctrine/orm/src/Query/Parser.php:3017)
  at Doctrine\ORM\Query\Parser->StringPrimary()
     (vendor/doctrine/orm/src/Query/Parser.php:2993)
  at Doctrine\ORM\Query\Parser->StringExpression()
     (vendor/doctrine/orm/src/Query/Parser.php:3299)
  at Doctrine\ORM\Query\Parser->LikeExpression()
     (vendor/doctrine/orm/src/Query/Parser.php:2653)
  at Doctrine\ORM\Query\Parser->SimpleConditionalExpression()
     (vendor/doctrine/orm/src/Query/Parser.php:2535)
  at Doctrine\ORM\Query\Parser->ConditionalPrimary()
     (vendor/doctrine/orm/src/Query/Parser.php:2514)
  at Doctrine\ORM\Query\Parser->ConditionalFactor()
     (vendor/doctrine/orm/src/Query/Parser.php:2482)
  at Doctrine\ORM\Query\Parser->ConditionalTerm()
     (vendor/doctrine/orm/src/Query/Parser.php:2457)
  at Doctrine\ORM\Query\Parser->ConditionalExpression()
     (vendor/doctrine/orm/src/Query/Parser.php:2556)
  at Doctrine\ORM\Query\Parser->ConditionalPrimary()
     (vendor/doctrine/orm/src/Query/Parser.php:2514)
  at Doctrine\ORM\Query\Parser->ConditionalFactor()
     (vendor/doctrine/orm/src/Query/Parser.php:2482)
  at Doctrine\ORM\Query\Parser->ConditionalTerm()
     (vendor/doctrine/orm/src/Query/Parser.php:2457)
  at Doctrine\ORM\Query\Parser->ConditionalExpression()
     (vendor/doctrine/orm/src/Query/Parser.php:1392)
  at Doctrine\ORM\Query\Parser->WhereClause()
     (vendor/doctrine/orm/src/Query/Parser.php:883)
  at Doctrine\ORM\Query\Parser->SelectStatement()
     (vendor/doctrine/orm/src/Query/Parser.php:850)
  at Doctrine\ORM\Query\Parser->QueryLanguage()
     (vendor/doctrine/orm/src/Query/Parser.php:257)
  at Doctrine\ORM\Query\Parser->getAST()
     (vendor/doctrine/orm/src/Query/Parser.php:357)
  at Doctrine\ORM\Query\Parser->parse()
     (vendor/doctrine/orm/src/Tools/Pagination/Paginator.php:258)
  at Doctrine\ORM\Tools\Pagination\Paginator->unbindUnusedQueryParams(object(Query))
     (vendor/doctrine/orm/src/Tools/Pagination/Paginator.php:247)
  at Doctrine\ORM\Tools\Pagination\Paginator->getCountQuery()
     (vendor/doctrine/orm/src/Tools/Pagination/Paginator.php:120)
  at Doctrine\ORM\Tools\Pagination\Paginator->count()
     (vendor/pagerfanta/pagerfanta/lib/Adapter/Doctrine/ORM/QueryAdapter.php:56)
  at Pagerfanta\Doctrine\ORM\QueryAdapter->getNbResults()
     (vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php:371)
  at Pagerfanta\Pagerfanta->getNbResults()
     (vendor/twig/twig/src/Extension/CoreExtension.php:1570)
  at twig_get_attribute(object(Environment), object(Source), object(Pagerfanta), 'nbResults', array(), 'any', false, false, false, 35)
     (var/cache/dev/twig/36/3692ad3c26ebc916598237062d126a3e.php:182)
  at __TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b->block_content_title('r', 'S')
     (vendor/twig/twig/src/Template.php:182)
  at Twig\Template->displayBlock('r', 'S')
     (vendor/twig/twig/src/Template.php:254)
  at Twig\Template->renderBlock('r', 'S')
     (var/cache/dev/twig/95/957352b11b80bb752c2b6d5f52ef7771.php:111)
  at __TwigTemplate_05226f51c79b116598121e70c2b5a8a9->block_page_title('r', 'S')
     (vendor/twig/twig/src/Template.php:182)
  at Twig\Template->displayBlock('r', 'S')
     (var/cache/dev/twig/c4/c46260aeea041c0d598d5b83238480a1.php:91)
  at __TwigTemplate_59c5786fd79890b459ce46ecc14d10ac->doDisplay('r', 'S')
     (vendor/twig/twig/src/Template.php:405)
  at Twig\Template->displayWithErrorHandling('r', 'S')
     (vendor/twig/twig/src/Template.php:378)
  at Twig\Template->display('r', 'S')
     (var/cache/dev/twig/b4/b42627e01864d91bf7ee7d2710c15e7e.php:56)
  at __TwigTemplate_4f33419ce4919df4ca1b546eb002cfdc->doDisplay('r', 'S')
     (vendor/twig/twig/src/Template.php:405)
  at Twig\Template->displayWithErrorHandling('r', 'S')
     (vendor/twig/twig/src/Template.php:378)
  at Twig\Template->display('r', 'S')
     (var/cache/dev/twig/95/957352b11b80bb752c2b6d5f52ef7771.php:53)
  at __TwigTemplate_05226f51c79b116598121e70c2b5a8a9->doDisplay('r', 'S')
     (vendor/twig/twig/src/Template.php:405)
  at Twig\Template->displayWithErrorHandling('r', 'S')
     (vendor/twig/twig/src/Template.php:378)
  at Twig\Template->display('r', 'S')
     (var/cache/dev/twig/36/3692ad3c26ebc916598237062d126a3e.php:99)
  at __TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b->doDisplay('r', 'S')
     (vendor/twig/twig/src/Template.php:405)
  at Twig\Template->displayWithErrorHandling(array('paginator' => object(Pagerfanta), 'fields' => array('createdAt' => array('css_class' => '', 'format' => 'd/m/Y H:i', 'help' => null, 'label' => 'Date création', 'type' => 'datetime', 'fieldType' => 'datetime', 'dataType' => 'datetime', 'virtual' => false, 'sortable' => true, 'template' => '@EasyAdmin/default/field_datetime.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'fieldName' => 'createdAt', 'scale' => null, 'length' => null, 'unique' => false, 'nullable' => true, 'precision' => null, 'columnName' => 'created_at', 'property' => 'createdAt'), 'getCommercialNameAdmin' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Nom Commercial', 'type' => 'text', 'fieldType' => null, 'dataType' => 'text', 'virtual' => true, 'sortable' => false, 'template' => 'Admin/templates/details.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'columnName' => 'getCommercialNameAdmin', 'fieldName' => 'getCommercialNameAdmin', 'id' => false, 'length' => null, 'nullable' => false, 'precision' => 0, 'scale' => 0, 'unique' => false, 'property' => 'getCommercialNameAdmin'), 'type' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Domaine activité', 'type' => 'string', 'fieldType' => 'text', 'dataType' => 'string', 'virtual' => false, 'sortable' => true, 'template' => 'Admin/templates/categories.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'fieldName' => 'type', 'scale' => null, 'length' => 255, 'unique' => false, 'nullable' => true, 'precision' => null, 'columnName' => 'type', 'property' => 'type'), 'email' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Email', 'type' => 'string', 'fieldType' => 'text', 'dataType' => 'string', 'virtual' => false, 'sortable' => true, 'template' => '@EasyAdmin/default/field_string.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'fieldName' => 'email', 'scale' => null, 'length' => 255, 'unique' => false, 'nullable' => true, 'precision' => null, 'columnName' => 'email', 'property' => 'email'), 'phone_number' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Numéro téléphone', 'type' => 'string', 'fieldType' => 'text', 'dataType' => 'string', 'virtual' => false, 'sortable' => true, 'template' => '@EasyAdmin/default/field_string.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'fieldName' => 'phone_number', 'scale' => null, 'length' => 255, 'unique' => false, 'nullable' => true, 'precision' => null, 'columnName' => 'phone_number', 'property' => 'phone_number'), 'getFullAddress' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Adresse', 'type' => 'text', 'fieldType' => null, 'dataType' => 'text', 'virtual' => true, 'sortable' => false, 'template' => '@EasyAdmin/default/field_text.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'columnName' => 'getFullAddress', 'fieldName' => 'getFullAddress', 'id' => false, 'length' => null, 'nullable' => false, 'precision' => 0, 'scale' => 0, 'unique' => false, 'property' => 'getFullAddress'), 'getOwner.fullname' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Pro', 'type' => 'text', 'fieldType' => null, 'dataType' => 'text', 'virtual' => true, 'sortable' => false, 'template' => '@EasyAdmin/default/field_text.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'columnName' => 'getOwner.fullname', 'fieldName' => 'getOwner.fullname', 'id' => false, 'length' => null, 'nullable' => false, 'precision' => 0, 'scale' => 0, 'unique' => false, 'property' => 'getOwner.fullname'), 'total_open_offers' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Total offre ouverte', 'type' => 'integer', 'fieldType' => 'integer', 'dataType' => 'integer', 'virtual' => false, 'sortable' => true, 'template' => '@EasyAdmin/default/field_integer.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'fieldName' => 'total_open_offers', 'scale' => null, 'length' => null, 'unique' => false, 'nullable' => true, 'precision' => null, 'options' => array('default' => 0), 'columnName' => 'total_open_offers', 'property' => 'total_open_offers'), 'getAboAdmin' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Abo.', 'type' => 'text', 'fieldType' => null, 'dataType' => 'text', 'virtual' => true, 'sortable' => false, 'template' => '@EasyAdmin/default/field_text.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'columnName' => 'getAboAdmin', 'fieldName' => 'getAboAdmin', 'id' => false, 'length' => null, 'nullable' => false, 'precision' => 0, 'scale' => 0, 'unique' => false, 'property' => 'getAboAdmin'), 'completion_rate' => array('css_class' => '', 'format' => null, 'help' => null, 'label' => 'Completion %', 'type' => 'integer', 'fieldType' => 'integer', 'dataType' => 'integer', 'virtual' => false, 'sortable' => true, 'template' => '@EasyAdmin/default/field_integer.html.twig', 'type_options' => array('required' => false), 'form_group' => null, 'permission' => null, 'prepend_html' => null, 'append_html' => null, 'fieldName' => 'completion_rate', 'scale' => null, 'length' => 11, 'unique' => false, 'nullable' => true, 'precision' => null, 'options' => array('default' => '0'), 'columnName' => 'completion_rate', 'property' => 'completion_rate')), 'batch_form' => object(FormView), 'delete_form_template' => object(FormView), 'app' => object(AppVariable), 'pathToWeb' => '/var/www/html/../web', 'website_url' => 'https://dev.myworks.fr', 'IS_PROD' => 'false', 'requestExtFilters' => array(), '_request_parameters' => array('ext_filters' => array())), array('body_id' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_body_id'), 'body_class' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_body_class'), 'content_title' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_content_title'), 'global_actions' => array(object(__TwigTemplate_b823a6a38f939e4ee8bf01043e4c187e), 'block_global_actions'), 'search_action' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_search_action'), 'search_form' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_search_form'), 'filters_action' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_filters_action'), 'new_action' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_new_action'), 'batch_actions' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_batch_actions'), 'content_header' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_content_header'), 'main' => array(object(__TwigTemplate_b823a6a38f939e4ee8bf01043e4c187e), 'block_main'), 'table_head' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_table_head'), 'table_body' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_table_body'), 'item_actions' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_item_actions'), 'delete_form' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_delete_form'), 'content_footer' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_content_footer'), 'paginator' => array(object(__TwigTemplate_d01b6cdd1d91d228c1eb35c184bd8f6b), 'block_paginator'), 'body_javascript' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_body_javascript'), 'request_parameters_as_hidden' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_request_parameters_as_hidden'), 'list_form_filters' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_list_form_filters'), 'list_form_filters_fields' => array(object(__TwigTemplate_a17047e7bbe470e185909a38f376a686), 'block_list_form_filters_fields')))
     (vendor/twig/twig/src/Template.php:378)
..
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:416)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->searchAction()
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:912)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->executeDynamicMethod('search<EntityName>Action')
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:86)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->indexAction(object(Request))
     (src/Controller/Admin/AdminController.php:129)
  at AppBundle\Controller\Admin\AdminController->indexAction(object(Request))
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true)
     (vendor/bref/symfony-bridge/src/BrefKernel.php:48)
  at Bref\SymfonyBridge\BrefKernel->handle(object(Request))
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/var/www/html/vendor/autoload_runtime.php')
     (public/index.php:7)                
tbredillet commented 5 months ago

You must change $lexer->token['value']; To $lexer->token->value;