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.

CommentFileSizeAuthor
#7 views_php.tar_.gz12.21 KBinfojunkie
#6 views_php.tar_.gz11.71 KBinfojunkie
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

casey’s picture

I 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.

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea

OK. Thanks. I'm trying to backport. Let's see if works :)

claudiu.cristea’s picture

Refactored 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() and views_php_handler_field::php_post_execute() are never triggered while views_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%

claudiu.cristea’s picture

In addition to #3...

Also views_php_plugin_query::execute() is never triggered.

hook_views_pre_execute() and hook_views_post_execute() are called normally.

claudiu.cristea’s picture

It seems that the problem consist in the fact that Views 2 has no views_plugin_query and views_plugin_pager plugins. Those were added in 3.

Any idea for a workaround?

infojunkie’s picture

FileSize
11.71 KB

Attached 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.

infojunkie’s picture

FileSize
12.21 KB

Attached is a more polished version of the above that also supports D6 / Views 3.

casey’s picture

@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).

infojunkie’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Active » Fixed

Thanks casey! Committed code in #7 above to 6.x-1.x branch.

Status: Fixed » Closed (fixed)

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