- Issue created by @xiwar
- Assigned to xiwar
- 🇮🇪Ireland markconroy
Hi @xiwar
Thanks for reporting this and working on it. I've tried in a number of ways to replicate it but can't. Example:
1. Create Subsite overview node called "Test Subsite", with URL /test-subsite
2. Create term called "Test Subsite" in "Content Access by Path" vocabulary, with pathtest-subsite
3. Apply this term to a user
4. Go to /admin/content and see that the only nodes I can edit are my own nodes and the "Test Subsite" node
5. Edit "Test Subsite" node to call it "My Test Subsite", so the url is /my-test-subsite
6. Go to /admin/content and see that node is no longer available for editing - 🇬🇧United Kingdom xiwar
Hi @markconroy, thanks for the update.
I've re-tested this based on your example. I can trigger the error by doing the following.
As an Admin role
1. Create Subsite overview node called "Test Subsite", with URL /test-subsite
2. Create term called "Test Subsite" in "Content Access by Path" vocabulary, with path test-subsite as an admin role. "Content Access by Path" should only contain 1 term
3. Apply this term to a user. User should only have 1 term configured as above
4. Go to /admin/content and see that the only nodes I can edit are my own nodes and the "Test Subsite" node
5. Edit "Test Subsite" node to call it "My Test Subsite", so the url is /my-test-subsiteAs an Editor role
6. Go to /admin/content and see that the content listing page does not load with the error described in the ticket added to logs.
After digging into this a bit more, this only happens when there is 1 term mapped to 1 node which the Editor role has access to. If another term is added to the "Content Access by Path" vocabulary with an alias matching one configured on a node the Editor role has access to, the content listing page will load correctly without error.
In content_access_by_path_admin_content.module line 57, the $matches variables is NULL which triggers the error on line 58 since there are no matches and the Editor role is not the content owner.
$matches = array_merge($author_owned, $matches); $query->addWhere(0, 'nid', $matches, 'IN');
- 🇮🇪Ireland markconroy
markconroy → changed the visibility of the branch 3418083- to hidden.
-
markconroy →
committed c92f2d89 on 1.0.x
Resolve #3418083 "No results when null"
-
markconroy →
committed c92f2d89 on 1.0.x
- Status changed to Fixed
9 months ago 11:14am 12 February 2024 - 🇮🇪Ireland markconroy
Hi @xiwar
I tried your branch, but the module wouldn't install from it. Also, I am a little worried without more testing about using Link field. I get that it will work fine for the individual node, but I have a concern about nodes that use the current node as part of their paths without giving it a lot of testing. For example, if you are allowed to edit "Rugby" and the URL is
/sport/rugby
, will you also be able to edit/sport/rugby/world-cup
(as you should be).In the mean time, I fixed the specific issue we see (thanks for the detailed report), by:
- Checking if
$matches[]
has a value, - If so, doing the normal thing, and
- If not, setting
NULL
as the query value which forces the empty view message to appear. And then I've amended that view message to "Sorry, there is no content assigned for you to edit."
I'm going to mark this as fixed and create a new release. It might be good if you think it's worth it to create a follow-up issue titled "Change paths text field to a link field" and we can work on it from there.
- Checking if
- 🇬🇧United Kingdom xiwar
Hi @markconroy, that's great, thanks. I'll create a separate issue for this feature.
Automatically closed - issue fixed for 2 weeks with no activity.