THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Bonjour,
j'ai un pb avec criteria search.
Pour être sur, je l'ai désinstallé et réinstallé.

C'est une histoire de Warning: Undefined array key,
alors oui je sais qu'il faut mettre des default:null partout, ce que j'ai fait.

D'abord voici la stack trace :

ErrorException:
Warning: Undefined array key 1

  at local/modules/CriteriaSearch/Loop/CriteriaSearchAttributeLoop.php:110
  at CriteriaSearch\Loop\CriteriaSearchAttributeLoop->parseResults()
     (vendor/thelia/core/lib/Thelia/Core/Template/Element/BaseLoop.php:558)
  at Thelia\Core\Template\Element\BaseLoop->exec()
     (local/modules/TheliaSmarty/Template/Plugins/TheliaLoop.php:196)
  at TheliaSmarty\Template\Plugins\TheliaLoop->theliaLoop()
     (var/cache/dev/smarty/compile/ab4050c221f0daf1a1a41f35ec25e9b12d096bb1_0.file.category-edit.html.php:54)
  at content_63c69f185baf05_11937463()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:238)
  at Smarty_Internal_TemplateBase->_execute()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116)
  at Smarty_Internal_TemplateBase->fetch()
     (local/modules/TheliaSmarty/Template/SmartyParser.php:512)
  at TheliaSmarty\Template\SmartyParser->internalRenderer()
     (local/modules/TheliaSmarty/Template/SmartyParser.php:540)
  at TheliaSmarty\Template\SmartyParser->render()
     (vendor/thelia/core/lib/Thelia/Core/Hook/BaseHook.php:163)
  at Thelia\Core\Hook\BaseHook->render()
     (local/modules/CriteriaSearch/Hook/Admin/CategoryEditHook.php:23)
  at CriteriaSearch\Hook\Admin\CategoryEditHook->onCategoryTabContent()
     (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:115)
  at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:206)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:56)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:127)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (local/modules/TheliaSmarty/Template/Plugins/Hook.php:111)
  at TheliaSmarty\Template\Plugins\Hook->processHookFunction()
     (local/modules/TheliaSmarty/Template/AbstractSmartyPlugin.php:116)
  at TheliaSmarty\Template\AbstractSmartyPlugin->__call()
     (var/cache/dev/smarty/compile/0352f2f3e80847e15e116b05a2e24b54ff8ff239_0.file.module-tab-content.html.php:26)
  at content_63c69c42366004_41696693()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:385)
  at Smarty_Internal_Template->_subTemplateRender()
     (var/cache/dev/smarty/compile/03f6cd2c8b232169f320d2b0a994e271e06b2eb3_0.file.category-edit.html.php:702)
  at Block_177140868563c69c42000b77_12488627->callBlock()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:248)
  at Smarty_Internal_Runtime_Inheritance->callBlock()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:184)
  at Smarty_Internal_Runtime_Inheritance->process()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:186)
  at Smarty_Internal_Runtime_Inheritance->process()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:156)
  at Smarty_Internal_Runtime_Inheritance->instanceBlock()
     (var/cache/dev/smarty/compile/5218c217e109d719102f5937c056592811a3aac2_0.file.admin-layout.tpl.php:298)
  at content_63c69bfeb98761_30691443()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:385)
  at Smarty_Internal_Template->_subTemplateRender()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_inheritance.php:116)
  at Smarty_Internal_Runtime_Inheritance->endChild()
     (var/cache/dev/smarty/compile/03f6cd2c8b232169f320d2b0a994e271e06b2eb3_0.file.category-edit.html.php:71)
  at content_63c69c4204aa47_14281732()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php:123)
  at Smarty_Template_Resource_Base->getRenderedTemplateCode()
     (vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php:114)
  at Smarty_Template_Compiled->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:216)
  at Smarty_Internal_Template->render()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:238)
  at Smarty_Internal_TemplateBase->_execute()
     (vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php:116)
  at Smarty_Internal_TemplateBase->fetch()
     (local/modules/TheliaSmarty/Template/SmartyParser.php:512)
  at TheliaSmarty\Template\SmartyParser->internalRenderer()
     (local/modules/TheliaSmarty/Template/SmartyParser.php:540)
  at TheliaSmarty\Template\SmartyParser->render()
     (vendor/thelia/core/lib/Thelia/Controller/Admin/BaseAdminController.php:391)
  at Thelia\Controller\Admin\BaseAdminController->renderRaw()
     (vendor/thelia/core/lib/Thelia/Controller/Admin/BaseAdminController.php:347)
  at Thelia\Controller\Admin\BaseAdminController->render()
     (vendor/thelia/core/lib/Thelia/Controller/Admin/CategoryController.php:239)
  at Thelia\Controller\Admin\CategoryController->renderEditionTemplate()
     (vendor/thelia/core/lib/Thelia/Controller/Admin/AbstractCrudController.php:428)
  at Thelia\Controller\Admin\AbstractCrudController->updateAction()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:74)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/thelia/core/lib/Thelia/Core/TheliaHttpKernel.php:72)
  at Thelia\Core\TheliaHttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:184)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/thelia/core/lib/Thelia/Core/Thelia.php:438)
  at Thelia\Core\Thelia->handle()
     (web/index_dev.php:43)   

Pour moi, il y a un problème avec le fichier /backOffice/default/criteria-search/category/category-edit.html,
j'ai réduit le fichier au minimum pour avoir :

{loop type="search_attribute" name="search_attribute_loop2" }
         <td>{$ID|default:null}</td>
 {/loop}
 

Et que ce soit avec le paramètre category ou sans je recois le message d'erreur cité plus haut

Notez que si j'enlève ce code ou celui lié aux attributes,
le module s'affiche bien mais n'est pas (évidemment) utilisable.

C'est peut être moi qui rate un truc mais si c'est le cas je vois pas.

Last edited by vz777 (19-01-2023 14:42:17)

Offline


J'ai quand même l'impression que le message suivant dit qu'il y a un problème avec la loop ?

Uncaught PHP Exception ErrorException: "Warning: Undefined array key 1" at /../../../../local/modules/CriteriaSearch/Loop/CriteriaSearchFeatureLoop.php line 110 

Bon sinon en dehors de ces problème avec les features et attributes,
dans l'admin, j'arrive à lui faire afficher les filtres simples (prix, new, etc,) sauf que je dois aller vider le cache de dev (je ne suis qu'en dev) pour lui faire toggle le filtre.
Je suis arrivé à lui faire afficher une erreur :

Symfony\Component\ErrorHandler\Error\UndefinedMethodError:
Attempted to call an undefined method named "create" of class "Thelia\Core\HttpFoundation\Response".

  at local/modules/CriteriaSearch/Controller/Admin/ConfigurationController.php:66

Autre problème, coté front,
lorsque je cliq sur un de ces fameux filtres simples les routes ne sont pas trouvées :

GEThttps://www.domaine.tld/criteria/url/search/?category_id=1&page=1&new=true&limit=4&order=alpha
GEThttps://www.domaine.tld/criteria/render/search/?category_id=1&page=1&new=true&limit=4&order=alpha

Si je rentre directement la bonne url (https://www.domaine.tld/devgrv4/web/index_dev.php/category.html?category_id=1&page=1&new=true&limit=4&order=alpha dans le navigateur,
le filtre est bien appliqué.

Offline


Le problème est là : https://github.com/thelia-modules/Crite … p.php#L110

Manifestement, le tableau $searches ne contient pas les valeurs attendues.

Je ne connais pas ce module, il faudrait l'étudier pour trouver l'origine du problème.


OpenStudio Toulouse

Offline


Oui, j'aimerais tellement avoir les compétences pour le débugger,
mais force est de constater que mes principales seront ici de constater les bug et de lever l'issue.

Si il y en que ça intéresse, voici le lien : https://github.com/thelia-modules/Crite … h/issues/8

Offline


J'ai regardé un peu, j'ai trouvé quelques problèmes. Voilà une version de développement, dis moi si ça résous des problèmes: https://cloud.allimant.org/index.php/s/ … W/download


OpenStudio Toulouse

Offline


Ouh punaise je suis en lévitation wink Merci !

Bien alors, les modifs font que les features et attributes sont "togglables"/séléctionnables dans la page category coté back et front, ça roule.
Pour les filtres simples, le pb est résolu aussi.

Reste le pb coté front, ou
les filtres s'affichent, on peut les sélectionné, mais rien ne change car fausses routes.

Pour info, j'ai du désinstaller et résinstaller le module, car je me suis pris ça en voulant l'installer :

Thelia\Core\Event\Module\ModuleDeleteEvent::__construct(): Argument #1 ($module_id) must be of type int, Thelia\Model\Module given, called in /../../../../vendor/thelia/core/lib/Thelia/Action/Module.php on line 337

Last edited by vz777 (19-01-2023 02:27:31)

Offline


Les routes sont OK, je l'ai testé en local. Si rien ne change à la sélection des filtres c'est probablement a cause d'une erreur Javascript, regarde la console.


OpenStudio Toulouse

Offline


En effet,
le problème venait de mon template,
avec le template par défaut c'est ok.

Merci beaucoup

Le module fonctionne comme attendu
[Resolu]

Last edited by vz777 (19-01-2023 14:41:57)

Offline