I am running Drupal 7.32 and when I select the Crosstab View I get this:
Strict warning: Declaration of views_crosstab_table::pre_render() should be compatible with views_plugin_style::pre_render($result) in require_once() (line 13
Then there is an error message saying that the Views Crosstab style is not configured and it displays in plain tabular format.
Can you help?

Comments

joel_guesclin’s picture

Title: Views Crosstab style not configured » Strict warning crosstab pre_render not compatible with plugin style
Issue summary: View changes
scotwith1t’s picture

I was getting similar messages and changing

function pre_render(&$values) {

to

function pre_render($values) {

in plugins/views_crosstab_table.inc, line 463 got rid of the warnings for me.

danchadwick’s picture

@scotself: Doing so will disable the ability to add a summary row. There is an issue outstanding with the views module to fix the definition in views, but I'm sure it will never get committed. Ignore the warning if you want the feature.

scotwith1t’s picture

Hmmm. Indeed. The summary row is then incorrect. Can you point us to the views fix if someone has come up with a patch? Having settings.php turn off strict warnings seems a bit over the top and risks missing some other potentially important warnings?

When i put the '&' back i have more errors than just the one above, I assume they are all related since they all go away when I remove the '&'?

Notice: Undefined property: stdClass::$field_field_how_heard_about_ltl in views_handler_field_field->get_items() (line 715 of /var/www/mysite.com/sites/all/modules/contrib/views/modules/field/views_handler_field_field.inc).
Warning: Invalid argument supplied for foreach() in views_handler_field->advanced_render() (line 1053 of /var/www/mysite.com/sites/all/modules/contrib/views/handlers/views_handler_field.inc).
Notice: Undefined property: stdClass::$field_field_league_interest_1 in views_handler_field_field->get_items() (line 715 of /var/www/mysite.com/sites/all/modules/contrib/views/modules/field/views_handler_field_field.inc).
Warning: Invalid argument supplied for foreach() in views_handler_field->advanced_render() (line 1053 of /var/www/mysite.com/sites/all/modules/contrib/views/handlers/views_handler_field.inc).

  • DanChadwick committed 919b74d on 7.x-1.x
    Issue #2363781 by DanChadwick: Mitigate strict warning: Declaration of X...
danchadwick’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Fixed
StatusFileSize
new2.58 KB

I won't call this "fixed" but rather mitigated. Instead of honoring the argument passed to ::pre_render(), I put the summary row right into the view result. This would break any calls to pre_render that aren't passed ($this->result), but at least it gets rid of the log-clogging warnings, which you can't easily suppress with PHP7.

Status: Fixed » Closed (fixed)

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