The method \Drupal\rdf_entity\Entity\Rdf::hasGraph checks if the entity has a copy of itself into the specified graph.
However, the method fails if the entity is new and this method is called due to the lack of ID.
Even if there was an ID (like manually set before the entity is saved) it wouldn't make sense to run a query in the database since we know that it is new.
I am providing a test for the method itself that proves the issue and a fix.
The method
\Drupal\rdf_entity\Entity\Rdf::hasGraph
checks if the entity has a copy of itself into the specified graph. However, the method fails if the entity is new and this method is called due to the lack of ID. Even if there was an ID (like manually set before the entity is saved) it wouldn't make sense to run a query in the database since we know that it is new.I am providing a test for the method itself that proves the issue and a fix.