Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

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

Merged
merged 2 commits into from Apr 28, 2020
Merged

Conversation

idimopoulos
Copy link
Contributor

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.

@idimopoulos idimopoulos changed the title Provide a test for the hasGraph issue. Rdf::hasGraph breaks if the entity is new Apr 11, 2020
@pfrenssen
Copy link
Contributor

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 pfrenssen merged commit e9223b5 into 8.x-1.x Apr 28, 2020
@pfrenssen
Copy link
Contributor

I ran the test suite locally and all are passing.

@pfrenssen pfrenssen deleted the has_graph_is_new branch April 28, 2020 06:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants