Hi everyone,

I've recently started using this module alongside Fast Permissions Administration (https://www.drupal.org/project/fpa) and i noticed that the quick filter provided by this module would break the functionality applied by the permissions administration module.

There are a couple of problems here, the filter provided by this module, is duplicated, and entering a value in the filter breaks the permissions grouping applied by the Fast Permissions Administration module. (see break.png [viewing field ui permissions, able to filter to backup migrate permissions])

As this module's main aim is to overhaul the extend/modules page display/ux i thought it best to allow site admins to enable disable the permissions form alteration executed by this module. (see config.png)

I have whipped up a quick patch enabling site admins to enable/disable permissions filtering via the configuration page.
The patch is non breaking and default display of the permissions filter will be set to visible/true.

Can we look at rolling this into the next version?

Note: I have also cast, the checkbox integer values to boolean values on save and module update so that config in the database matches the format in the module_filter.settings.yml file.

Keep me updated, thanks again for your work on this module!
Josh

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

JParkinson1991 created an issue. See original summary.

gngn’s picture

Status: Active » Needs review
ilgnerfagundes’s picture

Status: Needs review » Needs work
StatusFileSize
new161.38 KB

An error occurred while applying the patch

jparkinson1991’s picture

@ilgnerfagundes i apply this patch using the netresearch/composer-patches-plugin and it applies fine against version 8.x-3.1.

Looking in the source of the composer-patches-plugin i see by default it adds the -p1 patch command argument. I think the lack of this argument in your git apply command is what's causing the problem.

Short answer: Add -p1

Documentation here: https://git-scm.com/docs/git-apply#Documentation/git-apply.txt--pltngt

codebymikey’s picture

Patch review:

The new config is missing the relevant config/schema definition.

The $config->set('tabs', (bool)$config->get('tabs')); line shouldn't be needed.

The 'Enable/Disable the filter on the permissions page.' string needs to be translated.

The cast on ->set('tabs', (bool)$values['tabs']) line isn't needed since the config schema is already aware that it should be a boolean.

codebymikey’s picture

Version: 8.x-3.1 » 8.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new3.26 KB

I've rerolled the patch for 8.x-dev, adding the appropriate coding standards and config schema.

codebymikey’s picture

Add config schema for the path configuration property, as well as casting to boolean as part of an update hook.

Also, does anyone have any timelines for when the next 8.x release will be?

jasonluttrell’s picture

I was having a conflict not with FPA, but between the Module Filter and Filter Permissions modules. I applied the above patch on Module Filter 3.1-dev in Drupal 9.0.5. It worked at first, but now the problem has returned, for some reason. I think it stopped working after running the DB update, though i'm not sure. Uninstalling Module Filter restores the Permissions page. (I also tried reinstalling both modules to no avail.) So, the patch does not appear to be working. The solution, for now, is to uninstall the Filter Permissions module until this issue is resolved.

As a cross-reference, this is also related to another thread:
#3123289: Filters out all roles and permissions. Can't set any.

manoloka’s picture

StatusFileSize
new18.41 KB

Patch in #7 worked for me however the behaviour is exactly the opposite I was expecting (or maybe I'm understanding it wrong). I mean, if I tick the setting "Permissions. Enable the filter on the permissions page.", it does not enabling the "permissions filter".

So it's actually enabling the filtering permissions when that setting it's not ticked.

Only local images are allowed.

manoloka’s picture

Hi again,

I'm just starting to work with composer so I tried to apply the patch in #7 through it and it's giving me this error "Could not apply patch! Skipping. The error was: Cannot apply patch " (see below)

To apply the patch I followed the instructions at https://groups.drupal.org/node/518975

I'm on Module Filter 8.x-3.1

Any idea of what could I be doing wrong?

Thanks
Manu

progatbarbera@hl338:~/barbe$ composer update --lock
Gathering patches for root package.
Removing package drupal/module_filter so that it can be re-installed and re-patched.
  - Removing drupal/module_filter (3.1.0)
Deleting web/modules/contrib/module_filter - deleted
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/module_filter (3.1.0): Loading from cache
  - Applying patches for drupal/module_filter
    https://www.drupal.org/files/issues/2020-07-27/3024306-7.module_filter.EnableDisable-Permissions-Filter-Avoids-conflicts-Patch-Inside.patch (patch module filter perms filter)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2020-07-27/3024306-7.module_filter.EnableDisable-Permissions-Filter-Avoids-conflicts-Patch-Inside.patch

Generating autoload files
23 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
progatbarbera@hl338:~/barbe$
jasonluttrell’s picture

I second what manoloka says about the checkbox. If anyone runs into the issue of the Filter Perms and Module filter modules conflicting, you have to uncheck "Permissions. Enable the filter on the permissions page" to get both to work.

manoloka’s picture

Ok, as per my comment in #10 it was my mistake I was trying to apply the patch to the latest recommended version instead of the Dev one. Once I upgraded Module Filter to the Dev version the patch apply without a problem.

Thanks and my apologies for my own mistakes :(

P.D. Actually there is a small problem, since upgraded to .dev the Module Filter not showing at admin/reports/updates but as is not related to this post I search a bit or open a new issue

codebymikey’s picture

Attached an update to the previous patch ensuring that the "tabs" options are still persisted.

mericone’s picture

I can confirm, patch from #13 adds an unchecked checkbox "Permissions. Enable the filter on the permissions page" at /admin/config/user-interface/module-filter configuration-page and solves the problem of Module-filter and Filter Permissions not working side-by-side together.

smustgrave’s picture

Version: 8.x-3.x-dev » 4.x-dev
smustgrave’s picture

Status: Needs review » Needs work

Patch no longer applies.

gskharmujai’s picture

I am also using Fast Permissions Administration (https://www.drupal.org/project/fpa) and i wanted the search textbox to be hidden in permissions page. I have adapted the patch to work for 4.x.

gskharmujai’s picture

Update the patch to pass tests.

anybody’s picture

Status: Needs work » Reviewed & tested by the community

Confirming RTBC for #18 for 4.x so this is ready for maintainer review and eventual commit :)

  • smustgrave committed 154b593e on 4.x
    Issue #3024306: Enable/Disable Permissions Filter (Avoids conflicts) [...
smustgrave’s picture

Status: Reviewed & tested by the community » Fixed

Thanks everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.