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.
When user has no access to the taxonomy term, we get an error in og_get_user_roles() function:
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7880 of /var/www/horizon/includes/common.inc).
OG relies on entity_load_single succeeding when it is not guaranteed to do so.
Comment | File | Size | Author |
---|---|---|---|
#2 | og-missing_bundle_property-2729253-2.patch | 460 bytes | alan-ps |
|
Comments
Comment #2
alan-ps CreditAttribution: alan-ps commentedShould the user have roles in a group he doesn't have access to? To my mind - no, and we can fix it by adding a simple check. I've attached a patch for review.
Comment #3
mxr576Comment #4
mxr576Comment #5
mxr576@alan-ps I think you should create a pull request on Github, because OG's development is happening there.
I've created an issue for this on Github as well: https://github.com/Gizra/og/issues/224
Comment #6
amitaibuAs an API function I don't think it needs to check for the correctness of the data we pass it.
One might argue, that instead of return, we should actually throw an Exception.
Comment #7
amitaibuI'll won't fix it. If you feel strongly differently, please re-open with an explanation why.
Comment #8
marcelovaniThat is the exception.
The reason we are getting this is because certain user belongs to groups that no longer exists.
I think this is a valid patch
Comment #9
claudfernandes CreditAttribution: claudfernandes commentedComment #10
claudfernandes CreditAttribution: claudfernandes commentedThanks @marcelovani, it is great, it has been buggy me for ages