- Issue created by @Bohus Ulrych
- First commit to issue fork.
- π«π·France m.anoune
m.anoune β made their first commit to this issueβs fork.
- π«π·France m.anoune
m.anoune β changed the visibility of the branch 8.x-1.x to hidden.
- Merge request !14[Issue #3425701/] Fix for accessing unpublished node translations by using... β (Open) created by m.anoune
- π¨πΏCzech Republic Bohus Ulrych Pilsen (Czechia)
Hello,
MR 14 generates errorThe website encountered an unexpected error. Please try again later. Error: Class 'AccessResult' not found in unpublished_node_permissions_node_access() (line 67 of modules/contrib/unpublished_node_permissions/unpublished_node_permissions.module).
After adding missing line
use Drupal\Core\Access\AccessResult;
it seems that it works and solved the problem with translations.Thanks
- Status changed to Needs review
4 months ago 9:59am 12 March 2024 - Status changed to Needs work
4 months ago 10:06am 12 March 2024 - πΊπ¦Ukraine AstonVictor
It's incorrect to fix it in that way:
- hook_entity_access doesn't work with queries and autocomplete fields. So, your changes create new bugs;
- it makes no sense to removeunpublished_node_permissions_node_grants()
but still useunpublished_node_permissions_node_access_records()
and rebuild node grants on module install.you can check the difference between access hooks here - https://api.drupal.org/api/drupal/core%21modules%21node%21node.module/gr...
- π§πͺBelgium JurgenR
We've had the same issue here and moved to https://www.drupal.org/project/view_unpublished β . That module does exacly the same thing, and is more globally used than this one.
I have been working on a patch to fix this issue. We have been testing and it seems to works fine. With this patch, the permissions are saved right on the node_access table in the database.