Postpone URI deletion in destruction phase

Created on 13 March 2024, 3 months ago
Updated 27 March 2024, 2 months ago

When deleting entities, we get:

PHP Fatal error:  Uncaught TypeError: Drupal\rdf_sync\RdfSyncSynchronizer::Drupal\rdf_sync\{closure}(): Return value must be of type string, null returned in /var/www/html/web/modules/contrib/rdf_sync/src/RdfSyncSynchronizer.php:119
Stack trace:
#0 [internal function]: Drupal\rdf_sync\RdfSyncSynchronizer->Drupal\rdf_sync\{closure}(Object(Drupal\joinup_licence\Entity\Licence))
#1 /var/www/html/web/modules/contrib/rdf_sync/src/RdfSyncSynchronizer.php(116): array_map(Object(Closure), Array)
#2 /var/www/html/web/modules/contrib/rdf_sync/src/RdfSyncSynchronizer.php(101): Drupal\rdf_sync\RdfSyncSynchronizer->doSynchronize(Object(Drupal\rdf_sync\Model\SyncMethod), Array)
#3 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php(51): Drupal\rdf_sync\RdfSyncSynchronizer->destruct()
#4 [internal function]: Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#5 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#6 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\TerminateEvent), 'kernel.terminat...')
...

The reason is that synchronization occurs after rdf_sync_entity_delete() because it runs in destruct phase and the URI has been already deleted.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡·πŸ‡΄Romania claudiu.cristea Arad πŸ‡·πŸ‡΄

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024