I am creating 'Userpoints' and 'Userpoint Transactions' views.

When I add a field of 'Point Category', I receive error:

Strict Standards: Declaration of userpoints_views_handler_field_category::init() should be compatible with that of views_handler_field::init() in /sites/all/modules/userpoints/views/userpoints_views_handler_field_category.inc on line 0

Strict Standards: Declaration of userpoints_views_handler_field_category::pre_render() should be compatible with that of views_handler_field::pre_render() in /sites/all/modules/userpoints/views/userpoints_views_handler_field_category.inc on line 0

Any ideas?

I am using D7.12 Views 3.2

Thanks.

Comments

guybrush’s picture

The reason is that the views_handler_field class parameter definition is different from the class userpoints_views_handler_field_category. The different is in the use of ampersands. This can be resolved in userpoints_views_handler_field_category.inc by changing the lines:
FROM: function init(&$view, $options) {
TO: function init(&$view, &$options) {

and
FROM: function pre_render($values) {
TO: function pre_render(&$values) {

If this is an acceptible change, I can write a patch for it

berdir’s picture

Please do so. That probably changed at some point in Views but was never updated in Userpoints.

guybrush’s picture

StatusFileSize
new833 bytes

Here is the patch. Note that it will also need to be applied to the 7.x-2.0 code

berdir’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
berdir’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, userpoints-views-parameters-1447666-3.patch, failed testing.

guybrush’s picture

StatusFileSize
new811 bytes

My last patch seemed to fail testing due to non-Unix line endings. Try this one instead

berdir’s picture

Status: Needs work » Needs review

Remember to set issues with patches to needs review so that they are tested.

Status: Needs review » Needs work

The last submitted patch, userpoints-views-parameters-1447666-7.patch, failed testing.

berdir’s picture

There's something wrong with the path of the file in your patch.

It's in a views subfolder, that needs to be reflected in the patch, e.g. a/views/...

guybrush’s picture

StatusFileSize
new835 bytes

Hopefully this one should be better. If not, can we catch up at DrupalCon Denver to resolve?

guybrush’s picture

Status: Needs work » Needs review
berdir’s picture

Status: Needs review » Fixed

Thanks, committed to both branches.

berdir’s picture

Double post. Slow network here :)

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

additional info.

robbe-1’s picture

You know, it would be helpfull if you brought this update to the recommended release. Just saying... (Not everyone is working with dev versions)

Jeroen94’s picture

Issue summary: View changes

@robbe: Agreed, it would be nice if this patch would be committed to the module's recommended version.