og_menu_access_unsubscribe is called from menu_get_item from the manage membership views field handler, meaning it could be called many, many times per page load (was being called 50 due to having 40 user membership view).
Even if that handler changed to not do the ugly fugly menu_get_item, it'd likely need to call this function, so not requiring a fully loaded user object (when none of the logic actually needs that) would be swell.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | og_menu_accesS_unsub_user_load-1661622-2.patch | 2.95 KB | hefox |
| og_menu_access_unsubscribe_no_userload.patch | 2.69 KB | hefox |
Comments
Comment #1
Grayside commentedLooks pretty solid.
Minor point:
Don't bother what? Don't bother with user_load()? Also, whitespace instead of period.
Comment #2
hefox commentedRe-roll that tries optimizing it further; no check if current user and adds a bypass check if calling it when know user exists (e.g. for [#7054328])
Comment #3
hefox commentedComment #4
claudiu.cristeaThis version of Drupal is not supported anymore. If this is still an issue in the
8.x-1.xbranch, please open a new up-to-date ticket. Closing.