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
Issue fork module_filter-3024306
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
Comment #2
gngn commentedComment #3
ilgnerfagundes commentedAn error occurred while applying the patch
Comment #4
jparkinson1991 commented@ilgnerfagundes i apply this patch using the
netresearch/composer-patches-pluginand 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
-p1patch command argument. I think the lack of this argument in yourgit applycommand is what's causing the problem.Short answer: Add
-p1Documentation here: https://git-scm.com/docs/git-apply#Documentation/git-apply.txt--pltngt
Comment #5
codebymikey commentedPatch review:
The new config is missing the relevant
config/schemadefinition.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.Comment #6
codebymikey commentedI've rerolled the patch for 8.x-dev, adding the appropriate coding standards and config schema.
Comment #7
codebymikey commentedAdd config schema for the
pathconfiguration 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?
Comment #8
jasonluttrellI 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.
Comment #9
manoloka commentedPatch 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.
Comment #10
manoloka commentedHi 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
Comment #11
jasonluttrellI 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.
Comment #12
manoloka commentedOk, 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
Comment #13
codebymikey commentedAttached an update to the previous patch ensuring that the "tabs" options are still persisted.
Comment #14
mericone commentedI 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.
Comment #15
smustgrave commentedComment #16
smustgrave commentedPatch no longer applies.
Comment #17
gskharmujai commentedI 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.
Comment #18
gskharmujai commentedUpdate the patch to pass tests.
Comment #19
anybodyConfirming RTBC for #18 for 4.x so this is ready for maintainer review and eventual commit :)
Comment #22
smustgrave commentedThanks everyone!