map prefilter not working properly

Martooti

Member
I have few maps made on one list.
For every map there is prefilter that should show data only published, sponsored and from one city. It look like it doesnt work. As far as I see when I zoom out one city - EL Gouna for example, I still see markers in Hurghada - which is different city.
It is a very big problem for me, since somehow when I open the list after I visited map visalisation, the list show me number of rows equals number of markers limited for map. If I do not specify number of markers that can be displayed on the map, and than go to menu with list, it shows all the rows , more than 2800!
If I do limit the markers to 20 lets say, and than go to list, it display 20 rows.
The problem is than if I know I have 20 rows for city el Gouna, and I can limit this, to do not casue a problem on list loading. I get for example 2 markers in El Gouna and 18 in the another city that was excluded by prefilter in the map visualisation.

Please help!

el gouna map:
http://redsea.abdoo-webdesign.com/directory/el-gouna/el-gouna-map

hurghada map:
http://redsea.abdoo-webdesign.com/directory/hurghada/hurghada-map

list of el gouna & hurghada
http://redsea.abdoo-webdesign.com/directory
 
I see it happening, but I'm not sure why, and I can't replicate it.

I suspect it may be something to do with having element filters on the same elements being used in the prefilters.

My best suggestion is that you copy the List, edit the elements which have filters on them in that copy (so unlink them), remove the element filters, and use that copy of the List for the viz(s). See if that fixes the problem.

-- hugh
 
I looked some more, and I would further suggest that you try a "from scratch" approach, with a clean page that has no other Fabrik forms or lists on it, no pre-filters, etc. Just a map viz on that table. Then start adding in pre-filters, your other modules with lists in them, etc.

I tried, by using a straight /index.php?option=com_fabrik&view=visualization&id=6, to see if that would work, but that errors out with what looks like a custom query using a dependent subquery, looking at category rgt values. And I have no clue where that's coming from.

-- hugh
 
I will try that. I have a query with rgt values for banners that are displayed in the modules. But they are in separate lists.
 
I take a look at the error. The problem is that query uses :

$app = JFactory::getApplication();
$cur_menu = $app->getMenu()->getActive()->id;

$table =$this->table->db_table_name;
$tableid= $this->table->id;
$db = JFactory::getDbo();
$db->setQuery("SELECT * FROM $table WHERE `category`=
(SELECT m.id FROM jos_menu AS m
INNER JOIN $table AS b ON b.category = m.id
WHERE lft <= (SELECT lft FROM jos_menu WHERE id = $cur_menu)
AND rgt >= (SELECT rgt FROM jos_menu WHERE id = $cur_menu)
ORDER BY rgt LIMIT 1) AND `published`='1';");

so when you try to open by using a straight /index.php?option=com_fabrik&view=visualization&id=6 $cur_menu seems to be empty, and that cause error.


I made a menu item with link only to :index.php?option=com_fabrik&view=visualization&id=5&latitude=27.2578&longitude=33.8117 hoping that this would work, but got error:

Warning: Creating default object from empty value in /home/goldenmanta/public_html/redsea/components/com_fabrik/views/form/view.base.php on line 55

Fatal error: Call to undefined method stdClass::getForm() in /home/goldenmanta/public_html/redsea/components/com_fabrik/views/form/view.base.php on line 56

And the link in the browser was: component/fabrik/?latitude=27.2578&longitude=33.8117&Itemid=332

Any idea what to do about it?
 
your Url must contain a parameter Itemid if you want to get the cur_menu
and as Hugh said
don't use common variables like $table, you may override the Fabrik model and so creating such errors

gesendet mit Tapatalk
 
I did change the $table, but still I am getting the same error.
The itemid in the link is menu item id.
Any suggestion what can I do about the error I got?
And also why the limit of one menu item are executed in the others? Is this normal? I mean I have a limit for display in the map 50, if I open the list that map is connected with (limit to display 20) it show me 50 rows etc.
 
re-reading your posts:
so you are trying to display different lists (or even the same list) and visualizations on the same site with different pre filters set not in list settings but in module/visualization/menue settings?
I think this can't be done.
Try to create an extra list for any of these places and set the prefilters ONLY in list settings.

gesendet mit Tapatalk
 
Actually it seems to be working generally. There is four different list with bannes that are displayed in the four different fabrik list modules on every page. They are using above query inside list template for the prefilter. I tried to put this query in list prefilter but it didnt work for limit.
There is also a list with event for example, that display correct on the page where are the banners as well.
They only problem I see happen is about googlemap visualisation and list connected with this google map.
I will try to check now on clean install if the strange behavior also appear.
 
I made a workaround for now with displaying the map. I use one of the Rob comments on other thread to insert lat and long within {fabrik view=visualization}. I made a few articles with specified lat and long and increase the markers shown to the number that will show all markers I need. Still the prefilter in the map are simply not working what is more important there is still a huge issue about limit for display. I cannot figure out how is it generated. Is is really possible that it use the limits from other menu item? Where should be the stronger limit definition? I already set up reset filter but it is still happening.
Any ideas are appreciated.
And I am keep trying to figure it out myself.
 
limit in map viz not working:
that's what I meant - create a new list (copy the old one) and add the prefilter there. Than remove the map prefilter completely and use the new prefiltered list in the map viz.
Also remove any prefilters in menu items.
Limits:
it's possible that it's using the menu limits if you are displaying the same list in a module and an article or a Fabrik list menu item.
Also in this case I think it should help if it's a different list (id) in any of these places

gesendet mit Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top