Skip to content
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

Conflict with User Role Editor filter #112

Closed
sanzeeb3 opened this issue Mar 22, 2020 · 3 comments · Fixed by #113
Closed

Conflict with User Role Editor filter #112

sanzeeb3 opened this issue Mar 22, 2020 · 3 comments · Fixed by #113
Assignees
Milestone

Comments

@sanzeeb3
Copy link

Describe the bug

This filter 'ure_full_capabilites' in the User Role Editor expects a full list capability return. Example format:

Array
(
    [activate_plugins] => Array
        (
            [inner] => activate_plugins
            [human] => Activate plugins
            [wp_core] => 1
        )

    [assign_give_form_terms] => Array
        (
            [inner] => assign_give_form_terms
            [human] => Assign give form terms
            [wp_core] => 
        )

    [assign_give_payment_terms] => Array
        (
            [inner] => assign_give_payment_terms
            [human] => Assign give payment terms
            [wp_core] => 
        )

while the same filter in this plugin return the $caps in the format:

Array (
    [activate_plugins] => activate_plugins
    [edit_plugins] => edit_plugins
    [edit_users] => edit_users
    [edit_files] => edit_files
    [manage_options] => manage_options
    [level_10] => level_10
    [delete_users] => delete_users

Specifications

  • Plugin Version: 1.8.5
  • WordPress Version: 5.3.2
  • Other plugins installed: WPForms

Additional context

Any plugin using this filter returning the format that 'User Role Editor' expects creates the issue. For example WPForms.

Steps to reproduce the issue:

  1. Install and active View Admin As and WPForms plugin.
  2. Enable error log.
  3. See the error.
@JoryHogeveen
Copy link
Owner

Hi @sanzeeb3

Do you get an error or notification?
I cannot find any changes in the URE plugin that indicates such a format. See: https://plugins.trac.wordpress.org/browser/user-role-editor/trunk/includes/classes/own-capabilities.php

In any case, I implemented the members hook members_get_capabilities, not the URE hook you mention. URE also has implemented the Members hook so if they want to support that they will need to use that format.

Cheers, Jory

@JoryHogeveen
Copy link
Owner

Hi @sanzeeb3

I think I understand your issue.
My compat code also parses the URE hook to fetch all capabilities that other plugins might add to that hook.
I'll change my code to just pass an empty array to that hook. I might even just remove it completely.

Cheers, Jory

@sanzeeb3
Copy link
Author

sanzeeb3 commented Mar 22, 2020

Yeah that. It's just a notice, though. This: https://wordpress.org/support/topic/causing-error-on-pages/

@JoryHogeveen JoryHogeveen added this to the 1.8.6 milestone Apr 1, 2020
@JoryHogeveen JoryHogeveen self-assigned this Apr 1, 2020
@JoryHogeveen JoryHogeveen mentioned this issue Apr 1, 2020
4 tasks
@JoryHogeveen JoryHogeveen linked a pull request Apr 1, 2020 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants