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.
I saw on the project description:
This is the successor of Views Custom Field for Drupal 7. There are no back-port plans.
Are there some API limitations that make this project not good for backport? Does it take advantages from some features from Views 3 that are not in Views 2?
I want to backport but need some information first.
Comment | File | Size | Author |
---|---|---|---|
#7 | views_php.tar_.gz | 12.21 KB | infojunkie |
#6 | views_php.tar_.gz | 11.71 KB | infojunkie |
Comments
Comment #1
casey CreditAttribution: casey commentedI am not sure. Views 3 and Views 2 do however differ a great deal regarding query and pager, which this module hacks into (and in a pretty nasty way). If you do provide a backport I am willing to make you maintainer for that branch.
Comment #2
claudiu.cristeaOK. Thanks. I'm trying to backport. Let's see if works :)
Comment #3
claudiu.cristeaRefactored the module, recreated the Views options form but I'm stuck in view generation. The values are not processed because
views_php_handler_field::php_pre_execute()
andviews_php_handler_field::php_post_execute()
are never triggered whileviews_php_handler_field::pre_render()
is called normally but with empty values.I guess is something related to your wrapping mechanism which I accept that I didn't manage to undestand 100%
Comment #4
claudiu.cristeaIn addition to #3...
Also
views_php_plugin_query::execute()
is never triggered.hook_views_pre_execute()
andhook_views_post_execute()
are called normally.Comment #5
claudiu.cristeaIt seems that the problem consist in the fact that Views 2 has no
views_plugin_query
andviews_plugin_pager
plugins. Those were added in 3.Any idea for a workaround?
Comment #6
infojunkieAttached is a backport of this module for D6 / Views 2. I'd be happy to maintain this branch and add support for D6 / Views 3 if there is interest.
I worked around the query plugin issue by moving the sorting code inside the post_execute functions. I don't think there is a need for the wrapping approach - unless my code doesn't work :-)
I also added a feature in the sort handler that I needed: the ability to programmatically add an ORDER BY clause to the query.
Comment #7
infojunkieAttached is a more polished version of the above that also supports D6 / Views 3.
Comment #8
casey CreditAttribution: casey commented@infojunkie, Granted you maintainer access. Given you also are maintainer of the views_custom_field.module, I expect you've done a great job (I don't have time to review any of it).
Comment #9
infojunkieThanks casey! Committed code in #7 above to 6.x-1.x branch.