ec-europa / rdf_entity

7 stars 9 forks source link

Rdf::hasGraph breaks if the entity is new #121

Closed idimopoulos closed 4 years ago

idimopoulos commented 4 years ago

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.

pfrenssen commented 4 years ago

We have no test coverage any more, Travis has been disabled for the ec-europa organisation. We should probably move this to a different organisation.

pfrenssen commented 4 years ago

I ran the test suite locally and all are passing.