Problem/Motivation

Remove the pbt widget because it consumes too much memory with 20K+ users and slows down page editing

Proposed resolution

Disable the widget that "Adds terms permissions info to the node form."

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

pemson18 created an issue. See original summary.

pemson18’s picture

Title: Adds terms permissions info to the node form. » Disable widget that "Adds terms permissions info to the node form."
pemson18’s picture

StatusFileSize
new530 bytes
bohemier’s picture

It would be great to have the option in the module configuration to disable the widget, similar to the "Show term selection in the user form" setting.

pemson18’s picture

pemson18’s picture

StatusFileSize
new2.18 KB
pemson18’s picture

Refactor Patch add schema and install definition and description fixes

  • 2b16b17c committed on 3.1.x-dev
    Issue #3507458: Disable widget that "Adds terms permissions info to the...
jepster_’s picture

StatusFileSize
new3.78 KB

Thanks for your patch. I have reviewed it.

1. permissions_by_term_form_node_form_alter: Here you stopping the function via your return statement at the top of the function. That way you are removing all other functionality. E.g. the form access controlling.
2. In the `SettingsForm.php` the default value for the "hide_terms_permissions_info_in_node_form" setting is true. But actually the value is not set, if the setting has not been saved manually, yet.

  • 33bed0bf committed on 3.1.x-dev
    Issue #3507458 by pemson18, peter majmesku, bohemier: Disable widget...
jepster_’s picture

Assigned: pemson18 » Unassigned
Status: Active » Fixed

I've added the changes to the new patch version release 3.1.36: https://www.drupal.org/project/permissions_by_term/releases/3.1.36

Please test the updates and reopen this issue and create a comment, if you stumble upon any issue with this update.

bohemier’s picture

Thanks for the great work Peter and Pemson, this works beautifully.

pemson18’s picture

StatusFileSize
new556 bytes
pemson18’s picture

I stumbled upon the setting not working if the condition is set in the permissions_by_term setting form. added #13 patch for the same. Requesting Peter for reviewing the same...

pemson18’s picture

Status: Fixed » Needs review
pemson18’s picture

Version: 3.1.35 » 3.1.36
jepster_’s picture

Status: Needs review » Postponed (maintainer needs more info)

You cannot just add a return statement here. It breaks the entire function. Also how any error can be reproduced here? I have tested this.

jepster_’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
StatusFileSize
new219.49 KB
new147.74 KB

I do not experience any issue here. If I switch the setting on or off via the settings form, I do see the expected behavior. The functionality works like designed.

See attached screenshots for clarification.

If you do experience an issue here:
* Please provide step-by-step instructions for the ability to reproduce this issue on a plain Drupal site with PbT installed.
* If you do have code changes: please create a issue fork with a merge request. That way code changes can be easily discussed via in-code comments.

Screenshot
Screenshot

jepster_’s picture

Status: Closed (cannot reproduce) » Fixed
pemson18’s picture

Hello Peter, should the permission supersede the settings. Since for the admin user the permission is enabled by default and the setting "hide the terms info on node edit page" doesn't come into effect.

jepster_’s picture

Hi pemson18, sorry - I do not follow. The config is global. This means that the config controls the form for all users. I think that's the intended behavior. Please provide more context, if you mean anything else.

pemson18’s picture

Hello Peter,
I have enabled the " Hide terms permissions information in the node form" setting in module settings. Also the permission by default has the been enabled for the admin user, The widget is displayed differently in the node edit form. It should have overridden the permission "Enables the specific role to see the term permissions on the node edit page" for the admin user and not display the users info in the edit form as in the screenshot showing allowed user info. Hope I am able to convey this issue properly.

pemson18’s picture

For Admin users the user information is loaded by default which sometimes breaks the site due to records having info 20k+ users. The show "Term permission information on node edit page" under permissions settings overrides the config "Hide terms permissions information in the node form." for admin users which in turn breaks the page load on Users info 20k+ records

jepster_’s picture

Status: Fixed » Needs work

Okay, thanks for your input. I do understand, that there is a mismatch between the config and permission setting. Then there should be a permission and config check in the merge request. This should be combined in one if-case. Feel free to provide a merge request and link it here. I can review it.

jepster_’s picture

Merge request review is easier than patch review. Just hit the "create issue fork" button at the top of this page.