PHP 5.3.1, D7 stable and latest Views 3.x-dev. Created node view with block display that is using taxonomy id filter and page display that is using taxonomy id in argument. On view edit page I have next errors:

* Strict warning: Declaration of views_handler_filter_term_node_tid::value_validate() should be compatible with that of views_handler_filter::value_validate() in require_once() (line 7 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_filter_many_to_one->option_definition() (line 24 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_filter_many_to_one.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_filter_many_to_one->option_definition() (line 24 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_filter_many_to_one.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_argument_many_to_one->option_definition() (line 36 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_argument_many_to_one.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_argument_many_to_one->option_definition() (line 36 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_argument_many_to_one.inc).

And then when looking page view with tid url argument

* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_argument_many_to_one->option_definition() (line 36 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_argument_many_to_one.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_argument_many_to_one->option_definition() (line 36 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_argument_many_to_one.inc).
* Strict warning: Declaration of views_plugin_argument_validate_taxonomy_term::init() should be compatible with that of views_plugin_argument_validate::init() in require_once() (line 11 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc).
* Strict warning: Declaration of views_plugin_argument_validate_taxonomy_term::options_submit() should be compatible with that of views_plugin_argument_validate::options_submit() in require_once() (line 11 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_argument_many_to_one->option_definition() (line 36 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_argument_many_to_one.inc).
* Strict warning: Non-static method views_many_to_one_helper::option_definition() should not be called statically, assuming $this from incompatible context in views_handler_argument_many_to_one->option_definition() (line 36 of /home/ivica/moje/bin/lampp_new/htdocs/yim3/sites/all/modules/views/handlers/views_handler_argument_many_to_one.inc).

Comments

pivica’s picture

Status: Active » Needs review
StatusFileSize
new4.06 KB

Here is a patch.

Please review part in views_handler_argument_many_to_one::option_definition()

Instead of

views_many_to_one_helper::option_definition($options);

I tried first

$this->helper->option_definition($options)

because I thought that helper is initialised in init(), but it was not the case so php just gave me fatal error "Call to a member function option_definition() on a non-object". So I added next code for this situation

if (isset($this->helper)) {
      $this->helper->option_definition($options);
    }
    else {
      $helper = new views_many_to_one_helper($this);
      $helper->option_definition($options);
    }

Same problem and solution I used for views_handler_filter_many_to_one.

dawehner’s picture

Init
-> calls parent init -> calls option definition
creates $this->handler.

So we could move $this->handler = up and call the instance of the helper. What do you think?

dawehner’s picture

Status: Needs review » Needs work

Additional this does not apply again git anymore.
Perhaps someone has to rerole the patch.

skadu’s picture

Experiencing the same issue using the 7.x.-3.0-alpha1. Based on dereine's last comment I am figuring that the provided patch does not solve the problem? Is this the case?

dawehner’s picture

Did you tryed the patch?

Pretty sure the patch worked, but it just don't apply anymore.

dawehner’s picture

Did you tryed the patch?

Pretty sure the patch worked, but it just don't apply anymore.

skadu’s picture

Hey dereine, I applied the patch by hand and no longer receive the Strict Warning. However, I now receive a Javascript alert that says "An error occured while attempting to process /views/ajax: Cannot call method 'toLowerCase' of undefined"

The odd thing is, when previewing the view, I receive this alert after I hit ok, the view sorts correctly even with the error. But when I am accessing the view at its page, i receive the same popup, but no sorting occurs.

I am going to double check my patch application later. Just wanted to give you a heads up. Thanks for looking into this, I will try to track down where it is coming from when I have a bit of time.

dawehner’s picture

Strict errors probably don't cause problems with js.

skadu’s picture

Hey dereine, you are correct, the errors were not related. My problem was this issues: http://drupal.org/node/1015960. Solved by the patch provided here: http://drupal.org/node/1015960#comment-3935328. Thanks for the initial patch on this issue.

kenorb’s picture

Anonymous’s picture

On the back of the last post I think this also may related: #1093032: Filter by Taxonomy Term - Can anyone advise? Still not sure whether I'm using the filters appropriately though.

john_t’s picture

I too am getting the following errors:

Declaration of views_plugin_argument_validate_taxonomy_term::init() should be compatible with that of
views_plugin_argument_validate::init() in require_once()

Declaration of views_plugin_argument_validate_taxonomy_term::options_submit() should be compatible with that of
views_plugin_argument_validate::options_submit() in require_once

I did search the forum and to try and address them I have already updated to the latest developers edition of drupal 7, PLUS applied the following fixes to no avail.

1. 1015960-12-exposed_filters_ajax_0.patch
2. 1022484-uc_product-views-image.patch
3. views-1025518.patch

Any suggestions on where to go from here would be very greatly appreciated.

amitaibu’s picture

Status: Needs work » Needs review
StatusFileSize
new2.63 KB

Re-rolled patch using latest -dev.

dawehner’s picture

Status: Needs review » Fixed

Commited. Thanks for providing the patch.

Status: Fixed » Closed (fixed)

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

danmcewan’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new1.08 KB

Reopened because this also applies to term tid arguments, per:

Strict warning: Declaration of views_plugin_argument_default_taxonomy_tid::init() should be compatible with that of views_plugin_argument_default::init() in require_once() (line 7 of [site]/drupal/sites/all/modules/contrib/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc).
Strict warning: Declaration of views_plugin_argument_default_taxonomy_tid::options_submit() should be compatible with that of views_plugin_argument_default::options_submit() in require_once() (line 7 of [site]/drupal/sites/all/modules/contrib/views/modules/taxonomy/views_plugin_argument_default_taxonomy_tid.inc).

Patch attached.

dawehner’s picture

Status: Needs review » Fixed

Thanks.

Commited to 7.x-3.x

Status: Fixed » Closed (fixed)

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