Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Notice: Trying to get property of non-object in userpoints_flag_flag() (line 145
Comments
Comment #1
Leeteq CreditAttribution: Leeteq commentedWhat is the status here, does it work only with Flag 1.x, and not with Flag 3.x or 2.x?
Comment #2
Tim Williams Scavenger CreditAttribution: Tim Williams Scavenger commented@vishy_singhal It's just a notice, not even a warning. Nothing to worry about and yes, it works with Flag 2.x & 3.x.
Comment #3
Anybody@Issue author: Please check out the 7.x-1.x-dev version. It's currently hidden on the module page. If the problem still exits, please tell us a bit more about the problem.
Comment #4
bdlangton CreditAttribution: bdlangton commentedI get the same issue dealing with Flag 3.9. The problem is that this module implements hook_flag() as:
function userpoints_flag_flag($action, $flag, $content_id, $account) {
While the flag module defines hook_flag_flag() as:
This is actually quite strange, as your module implements hook_flag() which doesn't exist anymore, yet it is being called. I wonder if since 'userpoints' module is enabled it is taking your function as if the 'userpoints' module is implementing hook_flag_flag(). Either way, hook_flag() doesn't exist, so this function would need updated to properly implement hook_flag_flag(), and also implement hook_flag_unflag().
Comment #5
bdlangton CreditAttribution: bdlangton commentedComment #6
kreynen CreditAttribution: kreynen at University of Colorado Boulder commentedAnytime I read something like "as your module implements" I want to flip a table. This code is licensed as GPL and shared on Drupal.org so that anyone else can continue development.
This is our module. Anyone who wants to contribute can make a request to be added as a co-maintainer. I scratched NAR's itch and moved on. @Anybody made the request 2+ years ago and made the initial changes to be compatible with the 3.x branch of Flag.
Obviously improvements continue to be made to both userpoints and flag. I'm happy to add anyone who can demonstrate they have the technical skills to improve the project as a co-maintainer and turn the project ownership over to any co-maintainer who shows they will manage the project well.
Comment #7
bdlangton CreditAttribution: bdlangton commentedExcuse me for using a word that you don't like. I understand that it's open source and anyone can contribute. I was running into the same problem as the original poster and the issue wasn't explained so I did that. I would be more than happy to dig deeper and provide a patch when I have time. I didn't have time to dig deeper when I posted but wanted to get information out there for anyone's (including mine) reference.
Comment #8
bdlangton CreditAttribution: bdlangton commentedThis is fixed in 7.x-3.0-alpha1 so I'm not sure that it needs to be addressed here.