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
Comment #1
guybrush commentedThe 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
Comment #2
berdirPlease do so. That probably changed at some point in Views but was never updated in Userpoints.
Comment #3
guybrush commentedHere is the patch. Note that it will also need to be applied to the 7.x-2.0 code
Comment #4
berdirComment #5
berdirComment #7
guybrush commentedMy last patch seemed to fail testing due to non-Unix line endings. Try this one instead
Comment #8
berdirRemember to set issues with patches to needs review so that they are tested.
Comment #10
berdirThere'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/...
Comment #11
guybrush commentedHopefully this one should be better. If not, can we catch up at DrupalCon Denver to resolve?
Comment #12
guybrush commentedComment #13
berdirThanks, committed to both branches.
Comment #14
berdirDouble post. Slow network here :)
Comment #15.0
(not verified) commentedadditional info.
Comment #16
robbe-1 commentedYou know, it would be helpfull if you brought this update to the recommended release. Just saying... (Not everyone is working with dev versions)
Comment #17
Jeroen94 commented@robbe: Agreed, it would be nice if this patch would be committed to the module's recommended version.