I'm not sure of the root cause - but upgrading from 6.x.2.6 caused the following two effects.

1) GMAP views no longer had data in the popups when you clicked on an icon. So for example if before you had
Title: My Location
Group: Red
Status: Active

Now, the popup would be there but it would display as
Title:
Group:
Status:

So where you would normally have content now you just have a blank after the colon.

2) If you had a CCK content type where a drop down was populated from a view. It no longer works and instead just displays a drop down of all the rows that would normally be there but with blank content.

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Be sure you have the latest gmap and cck modules. Changes in Views 2.7 cause issues like this (not, in fact, 2.9 or 2.10) and as far as I know both CCK and gmap have corrected for these ages ago.

rar’s picture

Component: page displays » Code
Status: Closed (won't fix) » Active

I've identified the issue as being related to a change between 6.x.2.6 and 6.x.2.7 (and after) in the file views/theme/theme.inc .

If I replace the file theme.inc from 6.x.2.6 but keep everything else from 6.x.2.10 then things are working as expected.

rar’s picture

The problem occurs because of the change from
$field_output = $view->field[$id]->theme($vars['row']);
which works to
$field_output = $view->style_plugin->get_field($view->row_index, $id);
which doesn't work.

$diff ../views.6.x.10.broken/theme/theme.inc views/theme/theme.inc
185c185
< $field_output = $view->style_plugin->get_field($view->row_index, $id);
---
> $field_output = $view->field[$id]->theme($vars['row']);

rar’s picture

merlinofchaos:
Be sure you have the latest gmap and cck modules. Changes in Views 2.7 cause issues like this (not, in fact, 2.9 or 2.10) and as far as I know both CCK and gmap have corrected for these ages ago.

Sorry I didnt' see this comment before posting my later 2.

I am running the latest CCK and Gmap modules.
I'm running CCK-2.6 and Gmap-6.1.1-rc1

Found the line where the issue is in theme.inc. See later posts for more details.

rar’s picture

I found bug #614292: CCK Reference fields based on views broken by recent change in views_plugin_style Views 2.7 (#502348) which talked about the views 2.7 issue. It doesn't apply I think because I'm just using a standard Chameleon template for this site - no custom theme function overrides and have CCK up to date.

merlinofchaos’s picture

I am dubious that you have everything up to date, because almost Views 2.7 was released Nov, 2009, yet here it is April and most people are running CCK just fine.

That change is not reversible; undoing that line will break a lot of things. I do agree that the stuff they are *currently* talking about in the issue you link to is probably unrelated.

rar’s picture

This is a pretty clean site - there are very few modules installed.

Here's the complete list. As you can see all things are up to date wrt security. There are some recommended updates for colorpicker, iframe, orgranic groups, and role-reference. But I'll update them one by one to see if they fix the issue but since this is running in production I'll have to do this during off hours and it may take a few days.

Advanced help 6.x-1.2
CCK groups 6.x-1.0-beta1
Colorpicker 6.x-2.0-rc3
   Recommended version: 	6.x-2.0 (2010-Feb-24) 	
Content Construction Kit (CCK) 6.x-2.6
Date 6.x-2.4
Devel 6.x-1.18
   Recommended version: 	6.x-1.19 (2010-Mar-19) 	
FusionCharts 6.x-1.0
GMap Addons 6.x-1.x-dev (2009-Mar-13)
GMap Module 6.x-1.1-rc1
Iframe 6.x-1.3
   Recommended version: 	6.x-1.5 (2010-Jan-03) 	
jQuery UI 6.x-1.3
Location 6.x-3.1-rc1
Organic groups 6.x-2.0
   Recommended version: 	6.x-2.1 (2010-Mar-16) 	
Role Reference 6.x-1.0
   Recommended version: 	6.x-1.2 (2010-Mar-29) 	
Token 6.x-1.12
Trackfield 6.x-1.0
Views 6.x-2.10
Views Custom Field 6.x-1.0
rar’s picture

Ok - I updated everything up to its latest non-dev release and the problem persists.

All I have to do is change
$field_output = $view->style_plugin->get_field($view->row_index, $id);

to
$field_output = $view->field[$id]->theme($vars['row']);

To get things working again.

Just to test to see if the theme has something to do with it I tried changing from Marvin to Garland. No good. Got the same effect.

The error is in this one line and the variable $field_output is local to the function template_preprocess_views_view_fields so it points to the error being in this module.

rar’s picture

Root Cause:

$view->row_index is empty

Gmap solution:
They now have to add that variable.

http://drupal.org/node/623234#comment-2279838
#623234: Views 2.7 - breaks field output - GMap marker info window (bubble) doesn't display fields correctly

----However ----
I'm guessing that most modules developers don't know about this subtle change to the views API. I recommend having a line that watches for this and either throws a warning to let people know you've changed things or adjust for it. E.g.

if (empty($view->row_index)) { 
  //oops module that calls views didn't have this new functionality
  $field_output = $view->field[$id]->theme($vars['row']);
} else { 
  $field_output = $view->style_plugin->get_field($view->row_index, $id);
}
as far as I know both CCK and gmap have corrected for these ages ago.

Gmap fix was 40 days ago.
Gábor Hojtsy - March 1, 2010 - 05:02
Status: reviewed & tested by the community » fixed

The fix though is still only in the -dev version. Until they release it or you put in the above patch I guess you will get a lot of tickets. :(

dawehner’s picture

Status: Active » Fixed

So use gmap dev version, thats trivial.

Or apply the gmap patch.

rar’s picture

Status: Fixed » Closed (won't fix)

I already applied the patch - that's why I know it corrected the issue. You missed my point.

The reason I left the status in "open" was because I was interested in the response from the "views" maintainers. There were two main ones
1) When an update is made: break backwards compatibility and not have any code-level checks or warnings. No mention of this issue in the release notes. Continue to answer support tickets. In this case the Status would change to "won't fix" or "by design"
2) Add 5 lines to watch for this error (see my previous comment for the code to "fix" the issue)

I don't see you adopting the code submissions, so I see your answer is #1. I've changed the status for you to be consistent with your comment.