InvalidArgumentException:$uri should be a string and cannot be null or empty

Created on 14 May 2024, 6 months ago
Updated 15 May 2024, 6 months ago

When I create a node of which RDF sync is enabled as below:

No fields are enabled with RDF syncing on page /admin/structure/types/manage/book/fields .
The node is created successfully, but there is an error on page /admin/reports/dblog

nvalidArgumentException: $uri should be a string and cannot be null or empty in EasyRdf\Resource->__construct() (line 69 of /var/www/html/drupal/vendor/sweetrdf/easyrdf/lib/Resource.php)
#0 /var/www/html/drupal/web/modules/contrib/rdf_sync/src/Normalizer/RdfSyncNormalizer.php(124): EasyRdf\Resource->__construct()
#1 /var/www/html/drupal/web/modules/contrib/rdf_sync/src/RdfSyncSynchronizer.php(132): Drupal\rdf_sync\Normalizer\RdfSyncNormalizer->normalize()
#2 /var/www/html/drupal/web/modules/contrib/rdf_sync/src/RdfSyncSynchronizer.php(104): Drupal\rdf_sync\RdfSyncSynchronizer->doSynchronize()
#3 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/KernelDestructionSubscriber.php(51): Drupal\rdf_sync\RdfSyncSynchronizer->destruct()
#4 [internal function]: Drupal\Core\EventSubscriber\KernelDestructionSubscriber->onKernelTerminate()
#5 /var/www/html/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#6 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#7 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(63): Symfony\Component\HttpKernel\HttpKernel->terminate()
#8 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(688): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
#9 /var/www/html/drupal/web/index.php(22): Drupal\Core\DrupalKernel->terminate()
#10 {main}

When I access the page /node/[nid]?_format=jsonld, it shows error: The website encountered an unexpected error. Try again later. The same detailed error log as above

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

🇨🇳China fishfree

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

Comments & Activities

  • Issue created by @fishfree
  • 🇨🇳China fishfree

    It turned out that it was caused by an entity_reference field, the RDF mapping of the target entity bundle is not enabled. We must enable RDF mappings of all the chained entity_reference fields.

  • Status changed to Closed: works as designed 6 months ago
Production build 0.71.5 2024