issue with combination w/ component (search)

More
11 years 6 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
Code:
JPluginHelper::importPlugin( 'search');
with something like this:
Code:
$uri = JFactory::getURI(); $__areas=$uri->getQuery(true); 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.

More
11 years 6 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
Time to create page: 0.614 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline