You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a widget filter for a widget list, build in query mode on a business page and using :currentEntity variable in the query. An exception is thrown Too few parameters given in query.
There are a few victoire and widget structural problem involve in this issue.
If we take a look at the actual WidgetFilter mechanics we goes with the following UML.
Here we can see that the core block for filter is made with BaseFilter extended class. The first problem with that is this sort off class are based on Form AbstractType class from Symfony. But they do way to much, the buildQuery method is called to build the request generated after filtered the widget list. This Method make no sense in this class since she should only build a form.
The buildForm method do here job, but she do more and not with the correct tools. Instead of building here query (used to populate the select field of the widget) with the Victoire QueryHelper, she used a custom method from ArticleRepository who are poorly coded (filterWithListingQuery).
The result of that method is query like the following:
SELECT t_tag
FROM Victoire\Bundle\BlogBundle\Entity\Tag t_tag
INNER JOINt_tag.articles t_article
WHERE t_article IN(
SELECT article
FROM Victoire\Bundle\BlogBundle\Entity\Article article
WHERE (article.status= :status
OR (article.status= :scheduled_status
ANDarticle.publishedAt<= :now))
AND article IN(
SELECT item
FROM Victoire\Bundle\BlogBundle\Entity\Article item
LEFT JOINitem.blog blog whereitem.category=:currentEntity
)
)
The issue comes from the fact that at this point doctrine doesn't know the value he has to associate with the parameter :currentEntity.
Resolution Ideas
The Query helper has a method to build a query for a widget using the :currentEntity parameter.
We should remove completely the method coming from the ArticleRepository and add a new sort of service using the QueryHelper. Idealy we should have, for the initial query building the select, a class based on the tag's EntityRepository and able to use the QueryHelper. And another to generate the filter's results on the widget list.
Related to
Bundle
--
--
--
Analytics
✔
Page
✔
Blog
X
Query
X
BusinessEntity
X
Seo
BusinessPage
Sitemap
Core
Template
Criteria
Twig
Filter
X
User
Form
ViewReference
I18n
Widget
X
Media
WidgetMap
UI
The text was updated successfully, but these errors were encountered:
Description
When creating a widget filter for a widget list, build in query mode on a business page and using
:currentEntity
variable in the query. An exception is thrownToo few parameters given in query
.There are a few victoire and widget structural problem involve in this issue.
If we take a look at the actual WidgetFilter mechanics we goes with the following UML.
Here we can see that the core block for filter is made with BaseFilter extended class. The first problem with that is this sort off class are based on Form AbstractType class from Symfony. But they do way to much, the buildQuery method is called to build the request generated after filtered the widget list. This Method make no sense in this class since she should only build a form.
The buildForm method do here job, but she do more and not with the correct tools. Instead of building here query (used to populate the select field of the widget) with the Victoire QueryHelper, she used a custom method from ArticleRepository who are poorly coded (filterWithListingQuery).
The result of that method is query like the following:
The issue comes from the fact that at this point doctrine doesn't know the value he has to associate with the parameter :currentEntity.
Resolution Ideas
The Query helper has a method to build a query for a widget using the
:currentEntity
parameter.We should remove completely the method coming from the ArticleRepository and add a new sort of service using the QueryHelper. Idealy we should have, for the initial query building the select, a class based on the tag's EntityRepository and able to use the QueryHelper. And another to generate the filter's results on the widget list.
Related to
The text was updated successfully, but these errors were encountered: