Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
liquidcms CreditAttribution: liquidcms commentedI 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).
Comment #3
NancyDruYes, I have encountered that problem. So why is the preferred version still 7.x-1.x?
Comment #4
enboig CreditAttribution: enboig commentedUpgrading give me an error on some views:
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?
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.
Comment #5
NancyDruI don't think your situation has anything to do with the original post.
Comment #6
enboig CreditAttribution: enboig commentedWell, it was asking for compatibility problems, and I was reporting one.
Comment #7
liquidcms CreditAttribution: liquidcms commentedYea, 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.
Comment #8
Liam MorlandNote 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.
Comment #10
liquidcms CreditAttribution: liquidcms commentedNot 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.