- Issue created by @joachim
- Merge request !103Editing a path alias on the server in the path alias admin UI causes a broken state with aliases on the client on pull → (Open) created by joachim
- 🇬🇧United Kingdom joachim
This changes the path alias processor to handle path aliases as entities.
The fact that the core path alias field sort of and sort of isn't a reference field makes it a bit more complicated than the entity reference processor.
I've added a base class for kernel tests too.
- Status changed to Needs work
3 months ago 11:38am 4 August 2025 - 🇮🇹Italy Bladedu Italy
Hi Joachim, I've tested this MR testing the scenario described here: https://www.drupal.org/project/entity_share/issues/3107278#comment-14282136 💬 Call to a member function getAlias on null Fixed and I received a fatal error as following
NOTICE: PHP message: Uncaught PHP Exception Exception: "The path_alias ID 1 given by node with UUID 8084220c-b00f-481c-8302-ee333e05b081 was not found on the server or was not accessible." at /var/www/html/web/modules/contrib/entity_share/modules/entity_share_client/src/Plugin/EntityShareClient/Processor/PathAliasProcessor.php line 193 - 🇬🇧United Kingdom joachim
I don't really follow your steps to reproduce, sorry.
Could you repost them here, and use meaningful labels for client / server as I can't keep track of 'SA' and 'SB'!Also, if you could debug to see why the JSONAPI request isn't querying for the right thing, that would be a big help.
- 🇮🇹Italy Bladedu Italy
I strongly advice to read that old discussion to get acquainted with the general issue and the Drupal core.
To easy the steps to reproduce the bug I will describe here with more "talking labels"
setup
To start with we got 2 Drupal websites with path module from coreinstalled: one on server side which will simply call server and it is where entity_share_server is installed and running.
The other Drupal instance would be client with simply entity_share_client installed.ON client instance we have two node content types: blog and remote_event
ON server instance we only have the content type remote_event and both client and server share the same structure.The entity remote_event will be the one in share between the sites (on server side we create a channel for it).
Last thing: create a remote entity and activate the path processor.steps
- create a node of type blog and choose a random path alias
- create a node of type remote_event on server and assign a random path alias
- O client pull the remote_event entity created and it will trigger the exception described above
Please let me know if that helps.
- 🇬🇧United Kingdom joachim
I thought the steps on the other issue included deleting an entity?
- 🇮🇹Italy Bladedu Italy
Hi Joachim, no that scenario was not for deletion, but for the creation of path aliases when an entity has been syncronized and the path alias has to be created.
Yesterday I made a few more tests with xdebug active and I noticed that the problem was elsewhere.I had to grant Administer URL aliases permission to the user role that has access to jsonapi.
I saw you are the maintainer of https://www.drupal.org/project/path_alias_view_access → . I guess we're forcing a new dependency here to make this work without granting admin permissions to possibly limited roles.
I will give few more shots now I know this and see if I can cover all scenarios (and unlock the translation issue)
- 🇬🇧United Kingdom joachim
Yup, I made https://www.drupal.org/project/path_alias_view_access → for this use case, so the admin permission doesn't need to be granted to the Entity Share API role.
- 🇮🇹Italy Bladedu Italy
Wouldn't be better to force the dependency of this module in the info file of entity_share_server?
Maybe we should also document somewhere about this little thing. it took me a bit before understanding what was going on.
- 🇬🇧United Kingdom joachim
> Wouldn't be better to force the dependency of this module in the info file of entity_share_server?
No, because you might not be using that processor at all.
It's documented here:
> * description = @Translation("Prepares entity with the right path alias information. The client authorization needs to have access to view path alias entities on the server: the Path Alias View Access → module may be used for this."),
and in the README:
> * The path alias processor requires client authorization needs to have access to
view path alias entities on the server. The [Path Alias View Access
module]( https://www.drupal.org/project/path_alias_view_access → ) may be used for
this. - 🇮🇹Italy Bladedu Italy
Ok thank you. I'd say it works. I cannot find anything wrong with it.
I've also checked the scenario described in this issue https://www.drupal.org/project/entity_share/issues/3416720 🐛 Problem with "Path alias processor" together with translatable entities Active and, as you suggested, it did solve the issue.