- πΊπΈUnited States kruser
#8 fixed for us. In our case this module was causing tokens not to render. On the our status page, we had errors like:
Tokens or token types missing name property $info['types']['date'] $info['tokens']['node']['url'] $info['tokens']['file']['size'] $info['tokens']['user']['url'] $info['tokens']['date']['custom'] $info['tokens']['metatag']
The patch fixed it.
- π©πͺGermany donquixote
@colinstillwell, in the current context break and continue have the same effect, exiting the switch. However, as you can see from the diff and code, there is a break that will be called on the subseqent line (if the if isn't executed. As a result it appears that the continue was intended to target the foreach instead of the switch, and changing to continue 2 is the correct fix. If this is breaking your install, then you should consider what this is actually doing, which is checking if the user has access to filter by a given permission, and if not that filter should be skipped all together, using the continue 2 to skip to the next iteration of the foreach. Does that make sense?
Yes, from the code one should think the intended behavior was
continue 2;
.
But this only tells us that this was the intended behavior at the moment the developer wrote this, not that it is currently the intended behavior. Perhaps the intended or expected behavior is for this to just not work at all.To me the entire piece looks weird.
we are creating a user with uid = 'advuser_filter' and a roles array, and no other properties. We then pass this to user_access(), where the non-integer uid or missing properties might trip up access handlers.
I think the idea is to check this for "any user who is logged in".I think we need to better explain the expected behavior before we fix this.