- Issue created by @elbercastillomesa
After debugging I was able to notice that the actions for the
$form[submit]
element differ from the$form[overview]
(which is the form element for the "Save and go to list" button.
A "dirty" change and quick patch to include the "
permissions_by_term_submit
" action onto the list for the "Overview" element.If the change proposed could be improved, please don't hesitate and ping me, I'll be glad to learn.
- Assigned to elbercastillomesa
- Status changed to Needs review
7 months ago 4:18am 10 May 2024 - Issue was unassigned.
- 🇳🇴Norway gisle Norway
Unassigning. We need another community member to review the patch.
- 🇫🇮Finland anaconda777
Hi,
Applied patch, and tried to save again permissions for a term, but still it is not saved.
- Status changed to Needs work
6 months ago 12:57pm 5 June 2024 - Assigned to Tyapchyc
- 🇩🇪Germany Schoenef Unna
Hi guys, I have the same problem with 3.1.33 and the patch also does not work for me. To me this is a pretty critical issue, as it kind of makes this version unusable.
Some feedback would be great!
- 🇩🇪Germany Schoenef Unna
I also had a closer look now, and it looks like this happens for multi language setups. In my case the taxonomy had as language "not applicable", so the permissions by term are stored with langcode zxx - BUT when being loaded, it takes the current language (en) - so it is not found.
extending the queries to pull also und and zxx languages might help, but I got a feeling that this would touch very much the core of this module and also potentially introduce bad side effects. However, it would be desirable to allow language independent access taxonomies for multi language sides.
I did test this in web/modules/contrib/permissions_by_term/src/Service/AccessStorage.php:
Before:
public function getRoleTermPermissionsByTid($term_id, $langcode) { return $this->database->select('permissions_by_term_role', 'pr') ->condition('tid', $term_id) ->condition('langcode', $langcode) ->fields('pr', ['rid']) ->execute() ->fetchCol(); }
After (works as expected in the display, not tested further):
public function getRoleTermPermissionsByTid($term_id, $langcode) { return $this->database->select('permissions_by_term_role', 'pr') ->condition('tid', $term_id) ->condition('langcode', [$langcode, 'und', 'zxx'], 'IN') ->fields('pr', ['rid']) ->execute() ->fetchCol(); }
The language is all over, so this would definitely require thorough retesting and an architecture decision/evaluation of the main maintainers.
To make a long story short: Is there a way to support a language independent permission configuration in a multi language site?
Thx a lot!