Download & Extend

Mapstraction Views fail to display in Panels 3.x

Project:Mapstraction
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

When I create a mapstraction based view and call it from within a Panels 3.x Panels Page I get this error/warning message:

"Preview is disabled for the Mapstraction style plugin."

This is occurring when I view the Panel page on it's url. It also occurs on the Panels preview (but I sort of expected that :)

After looking at some of the modules code I found a conditional statement at the beginning of the render() function on Line 190 of the mapstraction_style_map.inc that calls this warning message if it's a view preview. If I remove this conditional, it then displays the view as desired on the panels page.

I'm not really sure at this point if this is an issue with panels 3 or mapstraction, but I thought I'd document it here first to see if others are experiencing problems with mapstraction views in panels 3

Comments

#1

This also occurs when I call a mapstraction based/styled view in a cck viewfield using the viewfield module.

#2

I'm running into that too..

#3

Status:active» needs review

A simple patch that adds a "Show results in preview" behaviour option.

AttachmentSize
mapstraction-n482152.patch 1.32 KB

#4

I haven't been able to get this to work in panels / panel pages. I get the rendered error message noted above;
couldn't apply the patch.. and wasn't successful just removing the conditional.

it'd be great if this worked with panels / panel pages.

#5

Try starting with the dev version and patching from there?

#6

I'm getting pretty much the same symptoms when using generic views API's views_embed_view() to render view in an arbitrary page.

(To be precise, I'm doing it via custom_formatters.module, but this means nothing special - the same would stand true if I do this via plain standard PHP filter, I guess).

It seems that a condition mentioned by redraven is too restrictive. What I've found is that we can relax it a bit to allow normal view rendering via views_embed_view(), but still have it disabled during editing.

Here's what's necessary to patch at mapstraction_style_map.inc:190:

-    if ($this->view->preview == TRUE) {
+    if ($this->view->preview == TRUE && $this->view->live_preview) {

I suppose, the first condition becomes redundant..

UPDATE: this fix still works for a HEAD revision of mapstraction.module, yet the line number must read: 229 instead of 190

#7

I had to remove Panels to get Mapstraction to work with any new data points that were added after I added the Panels module. Any nodes I added before would display correctly, and I could clone those nodes to display new nodes that would appear in Mapstraction. Even after I deleted the Panels module, I had to rebuild the Views for Mapstraction before it would start behaving normally.

Does this fix the Panels conflict once and for all? If this does fix it, can we get a new update to the Mapstraction? I would like to use Panels once again, but it's not worth the trouble if I get erratic behavior once again.

Thanks for the info.

#8

Could anyone, please, recheck this issue against the recent HEAD revision?

Chances are high that it got fixed with #808134: Implement polyline rendering, row plugin, libraries.module support and other improvements.

nobody click here