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

Commit

Permalink
rdf
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Jan 14, 2018
1 parent 9831ed7 commit 83140a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions web/modules/custom/asset_release/asset_release.module
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,7 @@ function asset_release_rdf_entity_presave(EntityInterface $entity) {
*/
function asset_release_entity_update(EntityInterface $entity) {
// Quick escape check to avoid unnecessary loadings.
if ($entity->bundle() != 'asset_release') {
return;
}

$enabled_bundles = \Drupal::config('rdf_draft.settings')->get('revision_bundle_rdf_entity');
if (empty($enabled_bundles) || !in_array($entity->bundle(), $enabled_bundles)) {
if ($entity->bundle() !== 'asset_release' || !\Drupal::service('sparql.graph_handler')->bundleHasGraph('rdf_entity', 'asset_release', 'draft')) {
return;
}

Expand Down
3 changes: 1 addition & 2 deletions web/modules/custom/collection/collection.module
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ function collection_rdf_entity_presave(RdfInterface $entity) {
* - When the entity is saved into the default graph, the draft must be deleted.
*/
function collection_rdf_entity_update(EntityInterface $entity) {
$enabled_bundles = \Drupal::config('rdf_draft.settings')->get('revision_bundle_rdf_entity');
if (empty($enabled_bundles) || $entity->bundle() != 'collection' || !in_array($entity->bundle(), $enabled_bundles)) {
if ($entity->bundle() !== 'collection' || !\Drupal::service('sparql.graph_handler')->bundleHasGraph('rdf_entity', 'collection', 'draft')) {
return;
}

Expand Down

0 comments on commit 83140a0

Please sign in to comment.