Closed (fixed)
Project:
Userpoints Node Action
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
8 May 2012 at 14:37 UTC
Updated:
26 Aug 2012 at 17:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
BillyMG commentedVery odd, but I'm not seeing that. Can you include a line number and/or your version of that function? It should be very easy to find in the userpoints_node_action.inc file. It may also be a PHP version thing, if you can tell me what version of PHP you're running.
Comment #2
Anonymous (not verified) commentedIt's line 460:
if ($node->$action !== null && $node->$action != $newStatus) {$action contains the name of the action (eg. "<Create>") and due to the < character it isn't printed with the message.
I think _userpoints_node_action_has_status_changed() should better be called with $actionID, see
patch attachedpatch at #3Comment #3
Anonymous (not verified) commentedThe patch above didn't consider the 'userpoints_node_created' action. I've added handling for it, but as I don't know much about the internals of this module, please check carefully.
Comment #4
Anonymous (not verified) commentedIt's related to #1158288: Points charge-off on un publishing, which might need a backport.
Comment #5
BillyMG commentedSorry about the delay, I didn't see this bug before. I've made some updates to DEV for 7.x and 6.x, so please give them a try after they update and let me know if this is still an issue.
Comment #6
Anonymous (not verified) commentedI can't actually find any relevant change against this issue in the latest dev 7.x!? Please consider my patch at comment #3. I didn't really provide it just for fun ;)
When feeding the _userpoints_node_action_has_status_changed() with the $actionName, line 461 will evaluate like:
if ($node->'<Sticky>' !== null && $node->'<Sticky>' != $newStatus) {This is all the PHP notice is about! (see, $node has not property called <Sticky>)
You'd need to use the $actionId instead (see my patch above!). Then the statement will evaluate like:
if ($node->sticky !== null && $node->sticky != $newStatus) {I hope it is clearer now to you.
The bug can be reproduced by making a node sticky for example. Other actions (unpublishing, promoting) will likely cause the same error message. Make sure to have PHP notices turned on to see the message, or consult the watchdog log.
Comment #7
BillyMG commentedWhoops, I made some changes, but the $actionID one didn't make it in. Sorry about that; give the new DEV build a try.
Comment #8
BillyMG commentedThis should be fixed with that recent build. If not, please open a new ticket.