You seem to be pushing people to 7.x-2.x to get maintenance, but the project page warns that it might not be compatible. What are the differences? What might I look for to see if I have compatibility problems?

Comments

NancyDru created an issue. See original summary.

liquidcms’s picture

I believe that the main difference between 1.x and 2.x is that 1.x never really worked correctly. $row->myfield would only return $nid, for all fields.. and as a result was pretty useless.

2.x came along and fixed this issue so that users could now properly access the field values (even re-written field values) in their PHP code.

The biggest issue now is that all/most PHP field code would need to be re-written if people did silly things like assume $row->myfield contained $nid as opposed to simply using $row->nid for $nid. I think, if they used $data->nid or $row->nid then code should be backward compatible (and be able to be greatly simplified with 2.x).

NancyDru’s picture

Yes, I have encountered that problem. So why is the preferred version still 7.x-1.x?

enboig’s picture

Upgrading give me an error on some views:

Fatal error: Call to a member function addMetaData() on string in /var/www/html/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1445

Returning the views_php_views_post_render() to views_php_views_post_execute() solve my problem; and is still returning the correct value for fields (and not nid). Am I missing some implications?

//function views_php_views_post_render($view) {
function views_php_views_post_execute($view) {
  // Restore original query plugin if it was wrapped.
  if ($view->query instanceof views_php_plugin_wrapper) {
    $view->query->php_unwrap();
  }
}

EDIT: I have checked git and the change was introduced to solve #1222448: Views PHP Can't Filter. Does the problem resides in my view?

EDIT2: after some research, the problem appear when using views_calc; when active without any grouping it works but $row variable in php field is empty, when using grouping and calculations it crashes.

NancyDru’s picture

I don't think your situation has anything to do with the original post.

enboig’s picture

Well, it was asking for compatibility problems, and I was reporting one.

liquidcms’s picture

Yea, sorry.. not sure.. I know i have used 7.2 (and 7.1) on many sites. I have never seen an issue with 7.2 but i rarely use it for filters as there is (usually) a huge performance impact associated with this.

Liam Morland’s picture

Status: Active » Fixed

Note that there are no update hooks to move to 7.x-2.x so you can move back and forth freely between 7.x-1.x and 7.x-2.x.

Edit: Clarified version numbers.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

liquidcms’s picture

Not sure what Liam is referring to, 1.x is certainly not compatible with 2.x. I think he is saying because there is no db update script that there isn't one required - that is not the case here.