issue with combination w/ component (search)

8 years 7 months ago #36379 by zouz747
Hello, here is my case:
    adv search module placed on all pages with adv link (to itemid)
    itemid used to flexihiddenmenu of type search
    J search plg disabled on content

What I want:
    search ran from module text-box must be flexisearch
    results shown in my itemid (with adv options enabled hidden)

What I get:
results twice (flexisearch + flexiadvsearch)

Due to:
all search plugins loaded in search model functions (getdata(), getareas())

Fix (suggestion): in both functions, replace
JPluginHelper::importPlugin( 'search');
with something like this:
$uri = JFactory::getURI();
JPluginHelper::importPlugin( 'search', !isset($__areas['areas']) ? 'flexisearch' : null);

When you're placed on your advsearch screen onwards, all posts seem to return correct results coming only from the flexadvsearch plugin

Please Log in or Create an account to join the conversation.

8 years 7 months ago #36384 by zouz747
I'm sorry, the pb is real but my suggestion below is wrong.
I had to tweak the code differently to have the system behave the way I need. Not sure you'd appreciate it but it goes like this:

1. search model:
Create var and the function to get it
Modify getdata(): add var to $dispatcher->trigger args
2. search view.html: set the model var to true just before calling get('data') if !JRequest::getVar('areas', array()) (or other method: here we point to the fact the advanced search screen is initialized with a simple search's results - but we need to have correct values in advanced filters according to ACL
3. plgadvsearch:
add param var to OnSearch & onContentSearch methods
in oncontentsearch, after setting global $fc_searchview; and its values, test var and quit (if var return;)

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.