Thank you for the wonderful project. I really appreciate it.
On the project page https://www.drupal.org/project/permissions_by_term you advertise the feature to restrict users to terms they have access to when they edit or create a node. The example on the project page is: "The taxonomy term "Only admin can access" will not be auto-completed. Because the user "tester" does not have access to it."
The feature worked great before updating to version 8.46.0 (8.45.0 did not work at all but resulted in a server error). In version 8.46.0 all taxonomy terms can be selected by all users although the users are not assigned to the roles that are assigned to the taxonomy terms.
In the "Manage form display" of the relevant content-type I observed the same behavior for all available widgets:
*) Check boxes/radio buttons
*) Select list
*) Autocomplete
*) Autocomplete (Tags style)
Greetings,
sevi
Comments
Comment #2
jepster_Thanks for reporting!
Does everything work as expected with new terms?
Comment #3
jepster_Comment #4
sevi commentedI created one new term for testing. Users without permission cannot select that term.
So yes, with the new term everything works as expected.
Comment #5
sevi commentedI found a way to resolve the problem manually:
In the database table permissions_by_term_role are three columns:
*) tid
*) rid
*) langcode
After updating to 8.46 the column langcode was empty for existing entries. For the new entry that I added after updating it was set to "en". I manually set langcode="en" for the existing entries and everything works as expected again.
Comment #6
jepster_Yes, I forgot to implement a upgrade path.
There will be an new version soon, which will add the language keys to the database records in the PbT tables. However, you must re-save the terms, if you have multiple languages. The 8.x-1.46 version supports access restriction for terms in multiple languages.
Comment #8
jepster_I have added an update hook in version 8.x-1.47. This update hook will add the language codes to PbT's tables. See https://www.drupal.org/project/permissions_by_term/releases/8.x-1.47.
Comment #9
jepster_