Skip Navigation

[Resolved] Passing a query between Views and MapPress

This support ticket is created 8 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.


This topic contains 15 replies, has 3 voices.

Last updated by Farrel 8 years, 3 months ago.

Assigned support staff: Caridad.



My topic refers to a previous thread who was marked as "resolved" :

I have a problem with the code that we had set up and allowed to pass to "Mappress" the query made by "Views".
As a reminder I use "Views" to filter a taxonomy named "Agencies" from two taxonomies "locations" and "services".
The result of the filter displays a list of agencies and points on a map (mappress in mashup mode).
The site is multilingual and managed by WPML.

The problem is as follows:
When the page appears without any filtering is done, Mappress mashup shows in the same map Fr and Uk agencies point. (see MappressViews1.jpeg)
If filtering is performed Uk agencies points disappear and so it resumes normal operation. (see MappressViews2.jpeg)

Have you an idea to pass before filtering the language setting to Mappress?

Thank you for your help.



Dear Stephane,

It will be much easier to resolve this if you can give me access to your Dashboard. You can send me the credentials using the boxes below the comment area. If you are not comfortable I can setup a test server for you instead.



Hi CaridadZ,

Your access are created.
Page concerned Mapress/Views :

(no filters selected, agencies duplicated)
hidden link

(expected behavior)
hidden link /?wpvlocalisation=Zone


Dear Stephane,

I dont see the MapPress plugin in the WPML compatibility list:

Have you seen this feature we recently added?

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.



Hi Caridad,

indeed it's not in the list ... You provided me a sortcode for the query to be passed from Views to Mappress and it worked very well until now.
View the history of our discussions on the previous thread about my request. (
I understand that you have developed your solution but I can't change the whole system that we have developed. I manage more than 200 offices on the website.

Tell me if you can help me because the system operates at 90%, I just have a problem to isolate markers UK and FR loading the page.

Thank you,


Dear Stephane,

I will have another look to see what I can do.



Dear Stephane,

Im not sure I understand. If you look in the browser error console you can see the SQL query that is being sent to the database. I have tested the SQL query with phpMyAdmin and it works fine, all results are french only.

SELECT   corpo_posts.* FROM corpo_posts   JOIN corpo_icl_translations t ON corpo_posts.ID = t.element_id
                        AND t.element_type IN ('post_agences') JOIN corpo_icl_languages l ON t.language_code=l.code AND WHERE 1=1  AND corpo_posts.ID NOT IN (915) AND corpo_posts.post_type = 'agences' AND (corpo_posts.post_status = 'publish') AND t.language_code='fr'  ORDER BY corpo_posts.post_date DESC  

Can you give me an example of a repeated location in the map so I can double check?



I Caridad,

If you go to this page without any filtering. :
hidden link

You can see the list of agencies displays links to Fr and Uk agencies.
If you filter solely by "zone" everything works.
See the screenshots provided.

thanks for your help.



hello Caridad

I have no news from you ...
Can we change the shortcode to use the language setting when loading the page without the filters being used?

add_shortcode('wpv-post-mashup', 'views_mashup');
function views_mashup($atts) {
global $WP_Views, $mappress;
$atts['query'] = $WP_Views->post_query->query_vars;
return $mappress->shortcode_mashup($atts);

Thank you,



Dear Stephane,

Excuse the delay, I have been looking for a solution but it turns out more complicated than I thought. will be looking into your issue later on today and get back to you with any progress I make.



Dear Stephane,

I will reply here today with a working solution.



Dear Stephane

The trick seems to be adding the following line at mappress_query.php around line 110 (in the query function)

		$query['suppress_filters'] = false;

But if you make the change, it will be overwritten with next update of the plugin. You should contact the plugin author to see if he can included this line too.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.



Hello Caridad

Thank you for your return. I will test this solution. Meanwhile we have developed a solution based on JQuery.
I'll let you know.

/ Stéphane


Dear Stephane,

I tried the code our test server and its working fine.
Let me know any problems you find.



Hello Caridad

This works perfectly, thank you very much. I will contact Chris Richardson to see if it can reflect the change to the code of the plugin.