I searched the other issues but couldn't find this strict warning:

Strict warning: Declaration of views_handler_argument::get_value() should be compatible with that of views_handler::get_value() in _registry_check_code() (line 2811 of C:\temp\xampp\htdocs\cms\includes\bootstrap.inc).

Not sure how to fix this. The attached patch simply adds $values, $field = NULL to the method declaration. Fix seems harmless but of course just adding parameters to a method might break a lot of things..

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Needs review » Fixed

Commited a slighly different version (c&p from views_handler) to both 6.x-3.x and 7.x-3.x

Thanks for the patch.

bojanz’s picture

Status: Fixed » Active

Do we really want to reuse the get_value() function name here?
get_value() does a completely different thing outside of arguments, so maybe the argument one should be renamed to something like get_argument_value().

Plus, I'm not sure where the argument get_value() is called from, but it didn't receive any parameters before, and now it wants the (unused) $values, which means we have a possible fatal error somewhere.

michielnugter’s picture

Glad to be of help.

#2
You can call a method without any parameters while it has some declared as required, can't remember why, think it has something to do with:

PHP 4 and above has support for variable-length argument lists in user-defined functions. This is really quite easy, using the func_num_args(), func_get_arg(), and func_get_args() functions.

EDIT: I do agree however the method name should be different if the implementation / usage differs from the original method.

johnv’s picture

This fix makes things worse then before. The function decarations is now: function get_value($values, $field = NULL) .
Modules calling get_value() now get the following warning (taken from GMap)
Warning: Missing argument 1 for views_handler_argument::get_value(), called in ...\modules\gmap\gmap_plugin_style_gmap.inc on line 147 and defined in views_handler_argument->get_value() (line 975 of ...\modules\views\handlers\views_handler_argument.inc).

Why should $values be obligatory, even when the function doesn't use it?

johnv’s picture

dawehner’s picture

Status: Active » Needs review
FileSize
1.5 KB

As bojanz said on irc he doesn't need get_value anymore in area handler because this doesn't have a field alias at the moment.
So here is a patch: move get_value back to handlers/views_handler_field.inc but keep sanitize_value because this definitive could be helpful for the other handlers. For example the argument handler to sanitize the title etc/the area hander to display something.

bojanz’s picture

Status: Needs review » Needs work

I'm actually using get_value() quite nicely in the area handlers (Drupal Commerce). Keep it where it is. We just need to rename this get_value() because it has no connection to the newer one.

merlinofchaos’s picture

The older get_value() is in use in contrib, such as project.module

dawehner’s picture

So the only way to fix it is that the area handlers provide them for themselves.
@bojanz

Didn't you said that the method is pointless because you don't have field_alias availible?

bojanz’s picture

Status: Needs work » Reviewed & tested by the community

Okay, then. I'm providing my own get_value() in the area handlers, so I can do that even with the original function somewhere else.

EDIT: Of course, you need to revert the change from the beginning of this issue as well (but that doesn't need to be in the patch).

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Committed and #1 reverted at the same time.

Status: Fixed » Closed (fixed)

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