Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using Drupal 7 version 7.39 when I save a node the users that have access to this node disappear from the grant tab.
I checked and the access is removed from node_access and nodeaccess tables.
I realize that the nodeaccess function nodeaccess_delete_user_reference it's called in the process. Inside this function user_load_multiple is called with a null value as parameter. In this case, user_load_multiple is returning all the users.
I did a small patch to overcome this. The path is also fixing the original problem of losing the data from the access tables.
Comment | File | Size | Author |
---|---|---|---|
#9 | nodeaccess-730664-3.patch | 1.22 KB | Petrica |
| |||
#5 | nodeaccess-730664-2.patch | 1.22 KB | Petrica |
| |||
nodeaccess-730664.patch | 788 bytes | dublutz | |
Comments
Comment #2
joelpittetPatch to be ported is when it needs a backport or forward port from 7 to 6 for example.
Comment #3
carsonwConfirmed the same issue on another website that reported this bug to me. Reviewed, applied, and tested successfully.
Comment #4
april26 CreditAttribution: april26 commentedI added the patch, but when the node is edited and saved, all the grant access names disappear. If anyone has a solution for this (or know of another module that allows view access by username), please let me know!
Comment #5
Petrica CreditAttribution: Petrica at European Commission and European Union Institutions, Agencies and Bodies commentedFor Drupal 7.41 this patch throws the following warnings:
I am attaching a patch to fix those.
Comment #8
joelpittet@Pertrica the testbot is failing on the short array syntax because Drupal 7 supports > PHP 5.2
Comment #9
Petrica CreditAttribution: Petrica at European Commission and European Union Institutions, Agencies and Bodies commentedAdded new patch for PHP 5.2 compatibility
Comment #10
joelpittet