Closed (fixed)
Project:
Views PHP
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 May 2019 at 19:22 UTC
Updated:
11 May 2021 at 18:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
spelcheck commentedComment #3
spelcheck commentedComment #4
kinmen commentedAfter applying that patch, I get:
Error: Class 'Opis\Closure\SerializableClosure' not found in views_php_create_function() (line 197 of /mypath/sites/all/modules/views_php/views_php.module).
I saw https://www.drupal.org/project/views_php/issues/2274543 therefore I think you should write here too that we need to install https://github.com/opis/closure/archive/master.zip into the libraries folder too (sites/all/libraries/closure)
Comment #5
spelcheck commentedNote: known issues when using in conjunction with Views Bulk Operations (VBO).
See: https://www.drupal.org/project/views_php/issues/2274543 #5 & #39
Comment #6
spelcheck commentedUpdated using #63 from https://www.drupal.org/project/views_php/issues/2274543.
Comment #7
liquidcms commentedapplied patch -68 and added closure library and my create_function() after switching to PHP 7.2 is now gone.. except for this notice:
Notice: Undefined offset: 0 in {closure}() (line 3 of /mnt/www/html/cppenvdev/docroot/sites/all/modules/views_php/views_php.module(197) : eval()'d code).
Comment #8
joseph.olstadpatch 6 (incorrectly named patch 68) is missing one backwards compatibility change.
This patch (patch 8) provides backwards compatibility with php 5.6.x (does not break backwards compat).
see patch and interdiff.
for an explanation, please see #2274543-63: [7.x-1.x] Remove usage of deprecated create_function()
Comment #9
joseph.olstadIf you experience issues using this above patch and in combination with views_bulk_operations you may need to use the patch I just created for the closure library :
I have also forked the closure library and this patch is included in my forked version.
https://github.com/joejoseph00/closure
Comment #10
joseph.olstadok, another patch, this time it requires version 3.4.0 or newer version of the opis/closure library.
Download the opis/closure library from github and extract it in your sites/all/libraries/
rename the closure folder (whatever zip calls it) and rename it to
closure(lower case)make sure your libraries module is enabled
then patch the views_php module version 2.x with this patch:
Comment #11
spelcheck commented@joseph.olstad thank you for taking this on! I am running into an issue with the latest patch though with a clean D7 installation.
Using views_php:2.x-dev, patched with views_php-3055655-10.patch and using closure:3.4.0 I receive the following error per view result:
The only php I'm using within the views_php field is value:
<?php print "foo"; ?>--
Note: When NOT using VBO, views_php-3055655-8.patch appears to work aok.
Comment #12
spelcheck commentedRolled
views_php-2274543-95.patchfrom https://www.drupal.org/project/views_php/issues/2274543 for views_php:2.x-dev and included interdiff.Working for me with no warnings on views_php:2.x-dev, VBO, PHP7.2. Great work @joseph.olstad!
Comment #13
joseph.olstadHi ya, extensive testing proves that the 7.x-1.x patch I created works well, thanks for fixing the 7.x-2.x patch!
Comment #14
ethomas08 commentedWeird but the rerolled patch in comment 12 did not apply for me when using the 7.x-2.x branch. I am attaching the patch that was successful for me in case that helps anyone else.
Comment #15
joseph.olstadnote: this patch requires the 'closure' library installed.
Download the opis/closure library from github and extract it in your sites/all/libraries/
rename the closure folder (whatever zip calls it) and rename it to closure (lower case)
make sure your libraries module is enabled
then patch the views_php module version 2.x with this patch
clear caches
Comment #16
allsite commentedAny chance a working patch could get rolled into a dev branch? I'd really appreciate it.
Comment #17
joseph.olstad**BEGIN EDIT** removed my own comment for clarity purposes **END EDIT**
Comment #18
liam morlandComment #19
SilviuChingaru commentedThe patch from #2274543-193: [7.x-1.x] Remove usage of deprecated create_function() for branch 7.x-2.x which is RTBC.
Comment #20
leducdubleuet commentedLatest patch views_php-remove_create_function-2274543-193-7.x-2.x.patch applies cleanly, works well and does not need the external 'closure' library.
I believe this is ready to roll, thank you!
Comment #21
liam morlandIf someone creates an issue fork and merge request, I will commit this.
Comment #22
leducdubleuet commentedWhat do you mean by "...an issue fork and merge request..."?
Isn't the current issue and the patch above in comment #19 enough?
Also why is the 2.x-dev now marked as unsupported?
Comment #23
liam morlandYou can read about Issue forks & merge requests.
I am working to get a 7.x-1.0 release. No one is actively maintaining any other branch. I doubt there will ever be a release.
Comment #24
leducdubleuet commentedOk thanks for the info, I am not yet familiar with forks and merge requests here, I'll conform when need be, no problem.
But I am not convinced it is worth the effort here with 2.x? I do not remember why I switched to version 2.x in the past but I just did a quick comparison between 1.x and 2.x and there are not many significant differences in my opinion. Maybe some things should be backported to 1.x so 2.x could be simply deleted and forgotten about?
Personally, I will simply do what it takes to switch back to version 1.x in my projects currently using 2.x.
Thanks for your time, it's great to see this module maintained again!
Comment #25
liam morland7.x-2.x was intended to be a branch with more feature development. At this point, it is not being developed and won't be unless someone comes on board as maintainer for this branch. All I am doing is getting final release of 7.x-1.0.
Comment #28
danyg commentedIssue fork and merge request have been created. I tested the patch at #19 and it works like a charm.
Comment #30
liam morlandI've committed this. Most people would probably be better off used 7.x-1.x. It is not much different from 7.x-2.x. 7.x-2.x does not have a maintainer and is not being developed.
Comment #31
danyg commentedThanks @Liam! I'll check soon what happens on downgrading the module to 7.x-1.x
Comment #32
liquidcms commented@Liam: " Most people would probably be better off used 7.x-1.x. It is not much different from 7.x-2.x. "
- huh? 7.2 and 7.1 are completely different.. and 7.2 works much better.
Comment #33
joseph.olstad@Liam, maybe republish 7.x-2.x , I had no idea it was better than 1.x?
Comment #34
liam morlandA user should come on board as the 7.x-2.x branch maintainer.
Comment #35
jan-e commented@liquidcms
Aren't you mixing up PHP 7.2 and PHP 7.1 with the 7.x-2.x and 7.x-1.x branches of this project?
Comment #36
liam morlandLet's move this discussion to #3210986: [Meta] Maintenance for 7.x-2.x and keep the present issue only for discussing any problems with the removal of create_function().
Comment #37
liquidcms commented@Jan-e. Definitely not.
In version 1.x you specify fields something like this:
$data->field_[field_name][0]['rendered']['#markup']
and the description text states there are variables like $row->field_name when in fact none of those work and only spit out NID
in version 2.x you specify fields as they are listed in the description text:
$row->field_name
but yes, I agree with Liam, this issue should just be about removing the deprecated function.. sorry..