Closed (fixed)
Project:
Hreflang
Version:
8.x-1.14
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2024 at 13:47 UTC
Updated:
25 Sep 2025 at 07:50 UTC
Jump to comment: Most recent
I get this error in the mercury editor edit page:
Drupal\Core\Entity\EntityMalformedException: The "node" entity cannot have a URI as it does not have an ID in Drupal\Core\Entity\EntityBase->toUrl() (line 161 of core/lib/Drupal/Core/Entity/EntityBase.php).
Mercury editor uses a iframe and i this there is the problem with hreflang.
In hreflang_page_attachments is not check if the varialbe $entity has values.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
carlitus commentedSomething strange has happened. I created the MR but when I clicked on the link after the push I had no access. I passed it to my partner paucala and he was able to access it.
Comment #4
mfbThis is a bit strange, as this code is more-or-less taken from core Content Translation module. So, you'd think you would also see this error when Content Translation is in use.
However, I can look into trying to reproduce this...
Comment #5
mfbI looked into this issue, and found that the code in Content Translation module would trigger the same exception. And so, apparently, Mercury Editor decided to simply disable the hook_page_attachments() implementation for Content Translation module, rather than properly fixing the issue. Therefore, you won't have any hreflang tags provided by Content Translation module if you enable Mercury Editor. So, that seems like bugs that need to be fixed in both Content Translation module and Mercury Editor.
In any case, we can resolve the issue in Hreflang module, at least...
Comment #8
mfbComment #9
mfbActually, looks like Mercury Editor re-implemented the Content Translation hook_page_attachments(), so you do get hreflang links after all. So, just a bug in core Content Translation module I guess.
Comment #11
carlitus commentedOops, I didn't see this reply, sorry.
Now the patch has failed, but I don't think it's necessary. The Mercury Editor no longer crashes, so it must have been fixed elsewhere.
Comment #12
mfb@carlitus this bug was fixed here in hreflang module, and was released in version 1.15
Comment #13
carlitus commentedOk, thanks!