Hi all,

I was working with 7.x-3.7 and when I've updated to 7.x-3.8 my pagers have disappeared. Then I have been testing and I found that only the views with one or more Global:PHP fields do that the pager doesn't work (in 7.x-3.7 everything was working).

Regards.

Comments

mas0h’s picture

I have the same issue after updating to 7.38.

jansete’s picture

Now I'm moving all my php fields in a module:

Is very simple:
My last code in global PHP:

return my_module_my_LAST_function($row->nid);

Now
my_module.info

name = MyModule Views
dependencies[] = views
core = 7.x
files[] = handlers/my_module_get_my_function.inc
files[] = my_module.views.inc

my_module.module

function my_module_views_api() {
  return array(
    'api' => 3,
    'path' => drupal_get_path('module', 'my_module'),
  );
}

my_module.views.inc

/**
 * Implements hook_views_data_alter().
 */
function my_module_views_data_alter(&$data) {
  $data['node']['n_field'] = array(
    'title' => 'Title',
    'help' => 'Description',
    'field' => array(
      'handler' => 'my_module_get_my_function',
    ),
  );
}

handlers/my_module_get_my_function.inc

class my_module_get_my_function extends views_handler_field_entity {
 
  function render($values) {
        return my_module_my_LAST_function($values->nid);
  }
}
gngn’s picture

We've got the same problem after updating to 7.38.
For now we reverted to 7.37.

bessone’s picture

Same problem to me, downgrading back to 7.37 fixed for now.

jansete’s picture

It could be nice moving all to your modules, store PHP in database is not the best practice and is insecure, I'm moving all now and is very easy. Try it guys!

Berliner-dupe’s picture

Same problem here.

Move to module is very very expensive because i have a lot of different views.

Is no other fix available?

Edit: I went back to Views views-7.x-3.7.

acdtrp’s picture

that''s a pretty serious bug! i'm glad that downgrade fixed it but i'm surprised that an official release with such bug can slip out.

dawehner’s picture

This issue is most probably caused by #1055616: Query arguments should be replaced before generating cache ID ... on top of that I really think that views_php should be adapted

jayvolk’s picture

Count me among those that have been bitten by this bug... Had to roll back... found out because client found out first.. ugh.
Pretty awful bug...

elantion’s picture

YES, I have to downgrade to 3.7... everything doing perfect...Not even the 3.7-dev can work.

Anonymous’s picture

im using 60 different views at my project... and a lot of them use Global PHP fields ... with selection about an 1500 results.... please im beggin you FIX that asap, because my boss is going to kill me soon... :(

mirsoft’s picture

I can confirm that solution in #2 works great.

The Global: PHP fields come from "Views PHP" module and this module should be always used only as a temporary quick solution (see note in the module description).

IMHO, modules like Views PHP should better never exist, because they attract developers with quick and dirty solutions, which may easily lead to overall misconcepted site. The issues like this and expensive fixes are then a result. Simply said, the best one can do is to uninstall this module, implement Views handlers properly and not wait for a patch - no matter what it costs.

johntang’s picture

Not all, How I can handlers filter with some views? Where is put the condition to detect special view?

dawehner’s picture

Status: Active » Fixed

Write a filter handler which uses the post_execute method for example should work, but those would have failed with the pager always already.

tuccio’s picture

Hey this is a major bug, just stop asking people to remove a popular module and to write a custom module to avoid running into this bug.

A bunch of views were working fine before the update 7.x-3.8, then after the update they are broken, and now I should remove a IMO great module (View PHP) and write a custom module and fix 10's if not 100's of views and you claim this issue is fixed??? That's just damn selfish and unconsiderate of all the Drupal builders who are not rocket scientists like yourself, or just are busier than you.

tuccio’s picture

Priority: Normal » Major
Status: Fixed » Active
tuccio’s picture

jaykaycgn’s picture

same Issue here. #17 seems to fix this. please provide a warning that this views-update breaks the site when using views php or release a bugfix-version instead of a feature update, geez.

manoj.surala’s picture

Same issue and I downgraded to 7.x-3.7.
The problem is in 3.8 version it is just taking the pager limit what I'm giving for the pager as the higher limit and zero as lower limit while retrieving the result from the database. Hence only that particular number of records are being fetched. How can a bug like this come out in the stable release? This bug just ate a day of mine. I never thought this could be a version problem. First time I faced this kind of problem with views though.

Seems like I should give a try which is there in this link https://drupal.org/node/2276165

dawehner’s picture

Status: Active » Fixed

There is still a patch in #2276165: Pager disappears when Global: PHP used in Views 3.8

@manoj.surala
Believe me or not, but I consider that stable version of software have more bugs than dev versions, simply because stable means that nothing changes. Many bugs get fixed in DEV months before what you call a stable release comes out.
On top of that I wonder why you actually use views PHP if it does not have a stable release at all :P

weekbeforenext’s picture

In trying to convert my Views PHP fields to proper Views fields, I found this great resource for adding Views fields that are not related to database tables.

Database independent Views 3 custom field handlers

Hope this help others.

Status: Fixed » Closed (fixed)

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

sadanand kenganal’s picture

Same issue and Revert back to 7.x-3.7.
Its working fine. Thanks guys.

I have written Global php for adding two fields. Its working fine. But, Views_cal module will not display page sum. All values will be zero. Any help. Please