-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal when using rua_get_level_caps() #15
Comments
Thanks for reporting this! The wp-content-aware-engine library is loaded pretty early in a page request (plugins_loaded, priority -1). Is there a reason switching levels is done before this? The problem with calling WPCALoader directly is that it might then load an older version of the library if 2 plugins use it (right now Restrict User Access and Content Aware Sidebars both rely on it). The "wpca/loaded" action is run immediately after the library has been loaded in "plugins_loaded". Could that hook be used when switching levels? |
Actually, I call if ( ! did_action( 'plugins_loaded' ) {
return;
} |
Lower than -1? I think a better option would be to just load WPCALoader even before that then, instead of loading it on demand in specific functions. It's actually best to make it load as early as possible (PHP_INT_MIN perhaps?) Edit: The only reason the library is loaded in a hook is to make sure that it's always the latest version of it that's being used. And plugins_loaded is the first possible hook to use for that. |
Why would it load an earlier version if it's loaded before EDIT: |
I see that now, that's a bummer. I think the problem still is that if another plugin defines a newer version of Would it solve it to load the library before -99999? It basically just registers a new post type, and sets up modules to handle conditional logic later (in Restrict User Access used for restrictions). It doesn't do anything outside hooks. |
Hmmm, could be a fix, as long as it doesn't do any |
Added the fix in View Admin As for now since I'm planning to release soon. |
Sorry for the delay here. No capability checks are made outside any hooks, so it should be safe to load it earlier than View Admin As. I think that is the only robust solution, as calling |
Okidoki! |
Fixed in d6c09ab, now wp-content-aware-engine is loaded much earlier, priority -999999 |
Hi Joachim,
I get this error when using
rua_get_level_caps()
:It has to be a new error since I never encountered it before. It currently happens when I switch to an access level. View Admin As fetches the level caps to set the proper view.
The text was updated successfully, but these errors were encountered: