Hi.

After upgrading over the weekend and enabling caching in each view, I'm seeing the above error in my logs from Boost. A complete sample from the logs is:

Dec 7 08:34:30 crca drupal: http://www.crca.org.au|1260174870|boost|65.55.207.78|http://www.crca.org.au/Resources/WordOfSalvation/TheSevenTrumpets||0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_handler_filter_many_to_one::init() should be compatible with that of views_handler_filter::init() [file] => /home/crca-website/public_html/sites/all/modules/views/handlers/views_handler_filter_many_to_one.inc [line] => 0 Lookup Error Type Turn Off Error Checking

Regards,

NIgel

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Active » Fixed

http://drupal.org/cvs?commit=299206

This was fixed by merlinofchaos.

Nigel Cunningham’s picture

Great. Should I try devel then? (Assuming there is one - haven't looked yet)

dawehner’s picture

yes there is. But the dev version needs perhaps 6 or 12 hours to be build. Perhaps its not fixed in the latest dev version.

merlinofchaos’s picture

Ack, I got distracted after the commit and did not post the patch that I used here:

Nigel Cunningham’s picture

Status: Fixed » Active

It looks to me like there are similar issues with some other code:

After that one is out of the way, i'm now seeing:

http://www.crca.org.au|1260266705|boost|67.195.112.126|http://www.crca.org.au/Resources/WordOfSalvation?page=10||0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_handler_filter_term_node_tid::value_validate() should be compatible with that of views_handler_filter::value_validate() [file] => /home/crca-website/public_html/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc [line] => 0 Lookup Error Type Turn Off Error Checking

and

http://www.crca.org.au|1260248779|boost|66.249.71.148|http://www.crca.org.au/AboutUs/WhoWeAre/Locations/Blaxland||0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_handler_filter::options_validate() should be compatible with that of views_handler::options_validate() [file] => /home/crca-website/public_html/sites/all/modules/views/handlers/views_handler_filter.inc [line] => 0 Lookup Error Type Turn Off Error Checking

Regards,

Nigel

dagmar’s picture

Status: Active » Needs review
Issue tags: +alpha-2 blocker
FileSize
2.46 KB

Yes, I found 2 more. Thanks for reporting.

Nigel Cunningham’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

That seems to have gotten rid of the errors. Unfortunately I've now discovered another (unrelated) bug - will go see if anyone has reported it already.

Nigel Cunningham’s picture

Status: Reviewed & tested by the community » Active

Hi again.

Got some more, I'm afraid...

Dec 11 02:19:07 crca drupal: http://www.crca.org.au|1260497947|boost|67.195.112.126|http://www.crca.org.au/category/Tags/resurrectionofChrist||0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_handler_filter::options_submit() should be compatible with that of views_handler::options_submit() [file] => /home/crca-website/public_html/sites/all/modules/views/handlers/views_handler_filter.inc [line] => 0 Lookup Error Type Turn Off Error Checking
Dec 11 02:22:11 crca drupal: http://www.crca.org.au|1260498131|boost|202.148.231.138|http://www.crca.org.au/|http://www.google.com.au/search?hl=en&source=hp&q=CRCA&meta=&aq=f&oq=|0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_plugin_style_default::options() should be compatible with that of views_object::options() [file] => /home/crca-website/public_html/sites/all/modules/views/plugins/views_plugin_style_default.inc [line] => 0 Lookup Error Type Turn Off Error Checking
Dec 11 02:22:11 crca drupal: http://www.crca.org.au|1260498131|boost|202.148.231.138|http://www.crca.org.au/|http://www.google.com.au/search?hl=en&source=hp&q=CRCA&meta=&aq=f&oq=|0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_handler_field_user::init() should be compatible with that of views_handler_field::init() [file] => /home/crca-website/public_html/sites/all/modules/views/modules/user/views_handler_field_user.inc [line] => 0 Lookup Error Type Turn Off Error Checking
Dec 11 02:25:51 crca drupal: http://www.crca.org.au|1260498351|boost|65.55.207.51|http://www.crca.org.au/Resources/WordOfSalvation/ByTitle?page=1||0||There are php errors on this page, preventing boost from caching. ERROR: Array [type] => 2048 [message] => Declaration of views_handler_filter_user_name::value_submit() should be compatible with that of views_handler_filter_in_operator::value_submit() [file] => /home/crca-website/public_html/sites/all/modules/views/modules/user/views_handler_filter_user_name.inc [line] => 0 Lookup Error Type Turn Off Error Checking

Regards,

Nigel

dawehner’s picture

Status: Active » Needs review
FileSize
13.19 KB

I greped and found some other ones.

all options_submit
all init
all value_submit

based on dagmars patch for views 3.x

merlinofchaos’s picture

So I should use #6 for Views 2 and #9 for Views 3? Or do we need a separate patch for Views 2?

dawehner’s picture

#9 Fixes much more places then #6. So #9 would have to be applied to 2.x too.

merlinofchaos’s picture

Status: Needs review » Needs work
Issue tags: -alpha-2 blocker

Committed to 3.x; however, this does not apply to 2.x. It probably should be rerolled for 2.x (and possilby 7.x-3.x?)

keinstein’s picture

FileSize
14.3 KB

adaption of views-653628.patch to 6.x-2.10 I didn't search for additional places.

there is still an error message “Declaration of views_plugin_row::options_validate() should be compatible with that of views_plugin::options_validate() E:\esg\sites\all\modules\views\plugins\views_plugin_row.inc:135”, but I don't know whats wrong there.

keinstein’s picture

I'm not sure, if I interpreted value_validate right. I've decided to use the form
function value_validate($form, &$form_state);
This triggers #774270 Can someone confirm that this interpretation is right?

dawehner’s picture

Status: Needs work » Needs review

Update ststus

Nigel Cunningham’s picture

Testing it now against views-dev from a day or two ago.

Nigel Cunningham’s picture

Still getting some:

views_plugin_access_role::options_submit() should be compatible with that of views_plugin_access::options_submit()
views_handler_filter_user_name::value_submit() should be compatible with that of views_handler_filter_in_operator::value_submit()
(Unrelated, I assume) rules_data_type_string::get_default_input_form() should be compatible with that of rules_data_type::get_default_input_form()

keinstein’s picture

FileSize
704 bytes
928 bytes
14.3 KB

I have another patch. This might be my last one on this issue. So don't rely on me, please.

There was one pre_render(&value) function somewhere in the views code. At a first glance I didn't know, how to avoid that. So I changed all occurrences of pre_render to be called by reference. This affects also the cck and the date module. I attach some prelimnary patches here. If you decide to follow my decition, they must be forwarded to the corresponding projects.

dawehner’s picture

Status: Needs review » Needs work

Please make a patch from the root of views. This is really hard to apply

dawehner’s picture

I did this for 7.x-3.x too, i think.

Kristen Pol’s picture

I'm seeing these errors when using authcache, and I'm not clear on the status of this... Is there a 6.x release that includes the fixes? Or do I need to use dev?

Thanks,
Kristen

dawehner’s picture

This is not even fixed in dev.

Kristen Pol’s picture

Thanks for the update. Do you need help getting it in for D6? Let me know what I can do.

Kristen

MohammadMoussa-Lebanon’s picture

hello every body ,im trying to make a website for sales, but im facing a problem which is , i have 3 categories apartments (for sale , for rent , to buy ) ,lands (for sale , for rent , to buy ) , buildings (for sale , for rent , to buy ) ,
all i want to do is to place 2 select boxes and let the user select in the first box if he want apartment wo land or building and in the second box for sale or for rent or to buy and click a button which create a query and show all in the same page, i mean all results must be in the same page,please help me im a new drupal user ,its a hard problem:S:S:
thanks alot

AlexisWilke’s picture

I have many similar problems right now, in 6x.3.x-dev

I suppose that options_validate() should not use the & but it was there except in two places so I re-instated it in my version. Works nice now. 8-)

function query($get_count = FALSE);
function options_submit($form, &$form_state);
function options_validate(&$form, &$form_state);
grep 'ion query' views/* views/*/*
views/handlers/views_handler_area.inc:  function query($get_count = FALSE) { }
views/handlers/views_handler_area.inc:  function query($get_count = FALSE) { /* No query to run */ }
views/handlers/views_handler_argument_formula.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_argument_group_by_numeric.inc:  function query($group_by = FALSE) {
views/handlers/views_handler_argument.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_argument.inc:  function query($get_count = FALSE) { /* No query to run */ }
views/handlers/views_handler_argument_many_to_one.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_argument_null.inc:  function query($get_count = FALSE) {}
views/handlers/views_handler_argument_numeric.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_argument_string.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_field_counter.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_field_custom.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_field_group_by_numeric.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_field.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_field.inc:  function query($get_count = FALSE) { /* No query to run */ }
views/handlers/views_handler_field_math.inc:  function query($get_count = FALSE) { }
views/handlers/views_handler_filter_boolean_operator.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_filter_boolean_operator_string.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_filter_group_by_numeric.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_filter.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_filter.inc:  function query($get_count = FALSE) { /* No query to run */ }
views/handlers/views_handler_filter_in_operator.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_filter_numeric.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_filter_string.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_relationship.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_relationship.inc:  function query($get_count = FALSE) { /* No query to run */ }
views/handlers/views_handler_sort_date.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_sort_formula.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_sort_group_by_numeric.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_sort.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_sort.inc:  function query($get_count = FALSE) { /* No query to run */ }
views/handlers/views_handler_sort_menu_hierarchy.inc:  function query($get_count = FALSE) {
views/handlers/views_handler_sort_random.inc:  function query($get_count = FALSE) {
views/includes/handlers.inc:  function query($group_by = FALSE) { }
views/includes/plugins.inc:  function query($get_count = FALSE) { }
views/plugins/views_plugin_display.inc:  function query($get_count = FALSE) {  }
views/plugins/views_plugin_exposed_form.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_exposed_form_input_required.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_pager_full.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_pager.inc:  function query($get_count = FALSE) { }
views/plugins/views_plugin_pager_none.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_pager_some.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_query_default.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_query.inc:  function query($get_count = FALSE) { }
views/plugins/views_plugin_row.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_style.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_style_summary.inc:  function query($get_count = FALSE) {
views/plugins/views_plugin_style_summary_jump_menu.inc:  function query($get_count = FALSE) {

grep 'ion options_validate' views/* views/*/*
views/handlers/views_handler_argument.inc:  function options_validate(&$form, &$form_state) {
views/handlers/views_handler_field_serialized.inc:  function options_validate(&$form, &$form_state) {
views/handlers/views_handler_filter_date.inc:  function options_validate(&$form, &$form_state) {
views/handlers/views_handler_filter.inc:  function options_validate(&$form, &$form_state) {
views/handlers/views_handler_sort.inc:  function options_validate(&$form, &$form_state) {
views/includes/handlers.inc:  function options_validate(&$form, &$form_state) { }
views/includes/plugins.inc:  function options_validate(&$form, &$form_state) { }
views/plugins/views_plugin_access.inc:  function options_validate(&$form, &$form_state) { }
views/plugins/views_plugin_access_role.inc:  function options_validate(&$form, &$form_state) {
views/plugins/views_plugin_argument_default.inc:  function options_validate(&$form, &$form_state) { }
views/plugins/views_plugin_argument_validate.inc:  function options_validate(&$form, &$form_state) { }
views/plugins/views_plugin_display.inc:  function options_validate(&$form, &$form_state) {
views/plugins/views_plugin_display_page.inc:  function options_validate(&$form, &$form_state) {
views/plugins/views_plugin_pager_full.inc:  function options_validate(&$form, &$form_state) {
views/plugins/views_plugin_pager.inc:  function options_validate(&$form, &$form_state) { }
views/plugins/views_plugin_query.inc:  function options_validate(&$form, &$form_state) { }
views/plugins/views_plugin_row.inc:  function options_validate(&$form, &$form_state) { }

grep options_submit views/* views/*/*
views/handlers/views_handler_area_text.inc:  function options_submit($form, &$form_state) {
views/handlers/views_handler_area_text.inc:    parent::options_submit($form, $form_state);
views/handlers/views_handler_argument.inc:  function options_submit($form, &$form_state) {
views/handlers/views_handler_argument.inc:      $plugin->options_submit($form['argument_default'][$default_id], $form_state, $options);
views/handlers/views_handler_argument.inc:      $plugin->options_submit($form['argument_validate'][$validate_id], $form_state, $options);
views/handlers/views_handler_filter.inc:  function options_submit($form, &$form_state) {
views/handlers/views_handler_sort.inc:  function options_submit($form, &$form_state) {
views/includes/admin.inc:  $display->handler->options_submit($form, $form_state);
views/includes/admin.inc:  $display->handler->options_submit($form, $form_state);
views/includes/admin.inc:  $form_state['handler']->options_submit($form['options'], $form_state);
views/includes/admin.inc:  $form_state['handler']->extra_options_submit($form['options'], $form_state);
views/includes/admin.inc:  $form_state['handler']->options_submit($form['options'], $form_state);
views/includes/admin.inc:  $form_state['handler']->options_submit($form['style_options'], $form_state);
views/includes/handlers.inc:  function options_submit($form, &$form_state) { }
views/includes/handlers.inc:  function extra_options_submit($form, &$form_state) { }
views/includes/plugins.inc:  function options_submit($form, &$form_state) { }
views/plugins/views_plugin_access.inc:  function options_submit($form, &$form_state) { }
views/plugins/views_plugin_access_role.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_argument_default.inc:  function options_submit($form, &$form_state) { }
views/plugins/views_plugin_argument_validate.inc:  function options_submit(&$form, &$form_state) { }
views/plugins/views_plugin_display_attachment.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_display_attachment.inc:    parent::options_submit($form, $form_state);
views/plugins/views_plugin_display_block.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_display_block.inc:    parent::options_submit($form, $form_state);
views/plugins/views_plugin_display_feed.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_display_feed.inc:    parent::options_submit($form, $form_state);
views/plugins/views_plugin_display.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_display.inc:          $plugin->options_submit($form['access_options'], $form_state);
views/plugins/views_plugin_display.inc:          $plugin->options_submit($form['cache_options'], $form_state);
views/plugins/views_plugin_display.inc:          $plugin->options_submit($form['query']['options'], $form_state);
views/plugins/views_plugin_display.inc:          $plugin->options_submit($form[$section], $form_state);
views/plugins/views_plugin_display.inc:          $plugin->options_submit($form['exposed_form_options'], $form_state);
views/plugins/views_plugin_display.inc:          $plugin->options_submit($form['pager_options'], $form_state);
views/plugins/views_plugin_display_page.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_display_page.inc:    parent::options_submit($form, $form_state);
views/plugins/views_plugin_exposed_form_input_required.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_exposed_form_input_required.inc:    parent::options_submit($form, $form_state);
views/plugins/views_plugin_pager.inc:  function options_submit($form, &$form_state) { }
views/plugins/views_plugin_query.inc:  function options_submit($form, &$form_state) { }
views/plugins/views_plugin_row_fields.inc:  function options_submit($form, &$form_state) {
views/plugins/views_plugin_row.inc:  function options_submit($form, &$form_state) { }
AlexisWilke’s picture

Just in case, I'm attaching a 3.x-dev patch.

Thank you.
Alexis Wilke

P.S. the patch below is not 100% complete, but that's a quite good start already.

AlexisWilke’s picture

This is still not resolved... and I have not gotten any good answer on whether it should be one way or the other. Maybe no one knows... 8-)

Anyway, there is me looking at the function query($get_count = FALSE) that remains. There are several still! (Most lost their parameters and for the few that did not yet lose their parameter they generally don't need it.)

So... function compile_fields() from views/plugins/views_plugin_query_default.inc around line 920:

  function compile_fields($fields_array) {
    $fields = $distinct = array();
    $non_aggregates = array();

    foreach ($fields_array as $field) {
      $string = '';
      if (!empty($field['table'])) {
        $string .= $field['table'] . '.';
      }
      $string .= $field['field'];
      // store for use with non-aggregates below
      $fieldname = (!empty($field['alias']) ? $field['alias'] : $string);

      if (!empty($field['distinct'])) {
        $string = "DISTINCT($string)";
      }

      if (!empty($field['count'])) {
        // Retained for compatibility
        $field['function'] = 'count';
      }

      if (!empty($field['function'])) {
        $info = $this->get_aggregation_info();
        if (!empty($info[$field['function']]['method']) && function_exists($info[$field['function']]['method'])) {
          $string = $info[$field['function']]['method']($field['function'], $string);
        }

        $this->has_aggregate = TRUE;
      }
      elseif ($this->distinct && !in_array($fieldname, $this->groupby)) {
        $string = $GLOBALS['db_type'] == 'pgsql' ? "FIRST($string)" : $string;
      }
      elseif (empty($field['aggregate'])) {
        $non_aggregates[] = $fieldname;
      }

      if ($field['alias']) {
        $string .= " AS $field[alias]";
      }

      if (!empty($field['distinct']) && empty($field['function'])) {
        $distinct[] = $string;
      }
      else {
        $fields[] = $string;
      }

      if (!empty($get_count_optimized)) {
        // We only want the first field in this case.
        break;
      }
    }
    return array(
      $distinct,
      $fields,
      $non_aggregates,
    );
  }

The if (!empty($get_count_optimized)) (last if() in the function) checks a function that's not defined.

Then the following function is a query($get_count = FALSE) which actually makes use of the $get_count variable which I would imagine will always be false since no other query() function has that parameter (and will break the whole thing since the base class defines query() without parameters.)

Note that the compute_fields() is probably trying to use $this->get_count_optimized and thus the query() function should too, methink.

Shall I continue?

tsphethean’s picture

Version: 6.x-2.8 » 6.x-2.16
Status: Needs work » Needs review
FileSize
6.04 KB

A little sad to be patching 2.16, but came across these warnings when doing a PHP 5.4 upgrade on an old site.

I've gone through the patch from #13 and manually applied what is outstanding from the latest release. This should apply cleanly against 2.16, or I can re-roll for dev if needed. Don't know if this is likely to be committed given what has moved on, but the patch file might be useful for someone else...

ajayg’s picture

Issue summary: View changes
Status: Needs review » Needs work

Patch applies fine, but missing two files which require similar changes
views_handler_filter.inc
views_handler_filter_date.inc

Gil_Gamesh’s picture

Seeing this in 7.26-1 when I activate the Calendar module.

Strict warning: Declaration of views_handler_filter_user_relationships_type::value_submit() should be compatible with views_handler_filter_in_operator::value_submit($form, &$form_state) in _registry_check_code() (line 3161 of /usr/share/drupal7/includes/bootstrap.inc).

v8powerage’s picture

This is very bad seems views is not meant to run on new versions of php...

tsphethean’s picture

Version: 6.x-2.16 » 6.x-2.x-dev
Status: Needs work » Needs review
Issue tags: +php54
FileSize
6.04 KB

Re-rolled the patch in #28 to add an ocurrance in views_handler_filter.inc (thanks @ajayg). I can't see any problems with views_handler_filter_date.inc

@-Shaman- - views will run on new versions of PHP, there are just a few patches that need applying. We're successfully running views on PHP 5.5 with this patch and a few others applied in our build process (using drush mask to make adding patches easy)

tsphethean’s picture

Issue tags: -php54 +php5.4
hass’s picture

Status: Needs review » Needs work
strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate($form, &$form_state) in sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in sites/all/modules/views/plugins/views_plugin_row.inc on line 134.
jackalope’s picture

I applied the patch in #32 to the newest version of views-6.x-2.x-dev; without the patch, the newer version results in no errors on my sites, but with the patch, there's tons of this sort of error. Does #32 actually regress the work done in the most recent dev version of the module?

osopolar’s picture

Status: Needs work » Closed (duplicate)
Issue tags: +PHP 5.4

Marking this as duplicate of #2411093: PHP strict warnings: Declaration of ... should be compatible with ..., as this issue initially was abut the init()-functions which seems that it got fixed in views 6.x-2.x. Looking at the patches seems that what is left is the PHP strict warnings problem.

vijaycs85’s picture

Though this issue is closed, the follow up deals with 6.x-3.x and this issue is about 6.x-2.x and here is the fix for #34 on top of the patch in #32

apaderno’s picture

Issue tags: -php5.4