Hi Jacques,
I think instead of setting dispatcher in groovy files I think we can fix
the work done under OFBIZ-9164
Instead of getting dispatcher from a session we can get this from the
request or can use the different method signature of
searchGetConstraintStrings method.
{code}
LocalDispatcher dispatcher = (LocalDispatcher)
request.getAttribute("dispatcher");
{code}
Thanks & Regards
--
Deepak Dixit
On Sun, Aug 19, 2018 at 9:00 PM, <[email protected]> wrote:
> Author: jleroux
> Date: Sun Aug 19 15:30:42 2018
> New Revision: 1838381
>
> URL: http://svn.apache.org/viewvc?rev=1838381&view=rev
> Log:
> Fixed: Search in Ecommerce no longer works
> (OFBIZ-10531)
>
> I guess that when I worked on OFBIZ-9164 I broke that.
>
> I found 3 occurences where the dispatcher was not in the session because
> the
> session comes from the request and the request has not it in.
>
> Modified:
> ofbiz/ofbiz-framework/trunk/applications/order/
> groovyScripts/entry/catalog/KeywordSearch.groovy
> ofbiz/ofbiz-framework/trunk/applications/product/
> groovyScripts/catalog/find/KeywordSearch.groovy
> ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/
> catalog/LayeredNavigation.groovy
>
> Modified: ofbiz/ofbiz-framework/trunk/applications/order/
> groovyScripts/entry/catalog/KeywordSearch.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
> applications/order/groovyScripts/entry/catalog/KeywordSearch.groovy?rev=
> 1838381&r1=1838380&r2=1838381&view=diff
> ============================================================
> ==================
> --- ofbiz/ofbiz-framework/trunk/applications/order/
> groovyScripts/entry/catalog/KeywordSearch.groovy (original)
> +++ ofbiz/ofbiz-framework/trunk/applications/order/
> groovyScripts/entry/catalog/KeywordSearch.groovy Sun Aug 19 15:30:42 2018
> @@ -28,6 +28,7 @@ import org.apache.ofbiz.product.product.
> module = "KeywordSearch.groovy"
>
> // note: this can be run multiple times in the same request without
> causing problems, will check to see on its own if it has run again
> +request.getSession().setAttribute("dispatcher",dispatcher)
> ProductSearchSession.processSearchParameters(parameters, request)
> prodCatalogId = CatalogWorker.getCurrentCatalogId(request)
> result = ProductSearchSession.getProductSearchResult(request, delegator,
> prodCatalogId)
>
> Modified: ofbiz/ofbiz-framework/trunk/applications/product/
> groovyScripts/catalog/find/KeywordSearch.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/
> applications/product/groovyScripts/catalog/find/KeywordSearch.groovy?rev=
> 1838381&r1=1838380&r2=1838381&view=diff
> ============================================================
> ==================
> --- ofbiz/ofbiz-framework/trunk/applications/product/
> groovyScripts/catalog/find/KeywordSearch.groovy (original)
> +++ ofbiz/ofbiz-framework/trunk/applications/product/
> groovyScripts/catalog/find/KeywordSearch.groovy Sun Aug 19 15:30:42 2018
> @@ -24,6 +24,7 @@ import org.apache.ofbiz.product.product.
> module = "KeywordSearch.groovy"
>
> // note: this can be run multiple times in the same request without
> causing problems, will check to see on its own if it has run again
> +request.getSession().setAttribute("dispatcher",dispatcher)
> ProductSearchSession.processSearchParameters(parameters, request)
> prodCatalogId = CatalogWorker.getCurrentCatalogId(request)
> result = ProductSearchSession.getProductSearchResult(request, delegator,
> prodCatalogId)
>
> Modified: ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/
> catalog/LayeredNavigation.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/
> ecommerce/groovyScripts/catalog/LayeredNavigation.
> groovy?rev=1838381&r1=1838380&r2=1838381&view=diff
> ============================================================
> ==================
> --- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/
> catalog/LayeredNavigation.groovy (original)
> +++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/
> catalog/LayeredNavigation.groovy Sun Aug 19 15:30:42 2018
> @@ -47,6 +47,7 @@ if (!parameters.clearSearch || !"N".equa
> ProductSearchSession.searchClear(session)
> }
>
> +request.getSession().setAttribute("dispatcher",dispatcher)
> ProductSearchSession.processSearchParameters(parameters, request)
> prodCatalogId = CatalogWorker.getCurrentCatalogId(request)
> result = ProductSearchSession.getProductSearchResult(request, delegator,
> prodCatalogId)
>
>
>