I was testing out the current og_get_group_audience_fields()
function for use in a custom module and I came across a potential issue. If you call og_get_group_audience_fields()
twice within the same request and include a different $group_bundle
parameter each time, then the second result appears to be the cached result of the first call.
The issue appears to occur because the cache identifier only includes $entity_type . ':' . $bundle_name . ':' . $group_type
and does not include the group bundle.
Not sure if this is by design. I was looking for a an easy way to get the group field name for a specific group bundle and needed to call the function twice within the same request for different group bundles. I can work around it, but just wanted to mention it in case it was an unknown bug.
Many thanks!
Comment | File | Size | Author |
---|---|---|---|
#3 | og-incorrect_results-2358929-3.patch | 1.17 KB | arnested |
Comments
Comment #1
shushu CreditAttribution: shushu commentedSeems like a bug for me.
Would it be possible to ask for a patch (and maybe even an enhanced test testOgUiAddPeopleMultipleAudienceFields to check it) ?
Comment #2
arnested CreditAttribution: arnested at Reload commentedPatch added.
Comment #3
arnested CreditAttribution: arnested at Reload commentedThe patch with the right paths this time.
Comment #5
amitaibuMerged, thanks.