To reproduce:

  • After installing and configuring the module
  • Create a new node for the type where the feature is enabled
  • Add input and interact with a button that makes an Ajax call, for example, add new paragraph item, add new Taxonomy term item etc

On the node form you'll see:
"Oops, something went wrong. Check your browser's developer console for more details"

On report log:

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 /public_html/web/core/lib/Drupal/Core/Entity/EntityBase.php).
Command icon Show commands

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

andreastkdf created an issue. See original summary.

andreastkdf’s picture

Issue summary: View changes

andreastkdf changed the visibility of the branch 1.0.x to hidden.

andreastkdf’s picture

Version: 1.0.0-alpha2 » 1.0.x-dev

The MR below should fix the issue. Adding a check that the node ID exists (which doesn't in the case of node creation) to avoid calling $node->toUrl() without an existing ID.

scott_euser’s picture

Status: Active » Needs work

Thanks for this! Added a comment, not 100% sure if NW or not, a bit of a question more - perhaps you can check and screenshot or screencast a new node creation with the patch applied to make sure that continues to work.

andreastkdf’s picture

StatusFileSize
new5.77 MB

Adding a screen recording of the bug for reference.

see error log on issue description.

scott_euser’s picture

Status: Needs work » Reviewed & tested by the community

Aha, so actually that should be fine; its not a real submit of this action and looking at https://git.drupalcode.org/project/ai_auto_reference/-/blob/1.0.x/ai_aut... we are only allowing generate button when Node ID is already known

scott_euser’s picture

Status: Reviewed & tested by the community » Fixed
scott_euser’s picture

Thanks!

andreastkdf’s picture

Status: Fixed » Needs work
StatusFileSize
new7.2 MB

Actually, I just checked #8 (with the patch applied fyi) but the button is showing on new node and more importantly the core save button doesn't work at all. not sure if this should be a different new issue.

see screen record:

scott_euser’s picture

Status: Needs work » Postponed (maintainer needs more info)

I can't seem to reproduce that, will need to have more steps, going to mark as postponed for now.

todor nikolov’s picture

I encountered the same issue when using the module. I ended up disabling the module for node "add/create" pages, because even if I fix the issue, the "Generate references with AI" button did not work for me. The module works fine on the "edit" pages of nodes. I think that generally the module won't work on the "add/create" node pages, because it redirects you which would then lose all of your progress. So as a temporary solution, you can use this patch to disable the module entirely on new nodes and use it once the node has been saved/created.

scott_euser’s picture

Applied your patch. Will have to figure out how to sort, but patch at least makes it not broken for now thanks!

todor nikolov’s picture

I just updated the module to the latest version (as of this message - 1.0.0-rc3) and I see that the changes from my patch have been added to the module. I'm leaving this comment for anyone who used this patch and is wondering why it's not applying on the newest module version.

scott_euser’s picture

Status: Postponed (maintainer needs more info) » Fixed

Very true! This should be marked as 'Fixed' not 'Postponed', sorry!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.