Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291693

Fatal error: Call to a member function url() on a non-object in line number 243 rdf.module

$
0
0

Getting the following error when trying to delete the forum in migration script.
Fatal error: Call to a member function url() on a non-object in line number 243 rdf.module

/**
* Implements hook_ENTITY_TYPE_storage_load() for comment entities.
*/
function rdf_comment_storage_load($comments) {
foreach ($comments as $comment) {
// Pages with many comments can show poor performance. This information
// isn't needed until rdf_preprocess_comment() is called, but set it here
// to optimize performance for websites that implement an entity cache.
$created_mapping = rdf_get_mapping('comment', $comment->bundle())
->getPreparedFieldMapping('created');
/** @var \Drupal\comment\CommentInterface $comment*/
$comment->rdf_data['date'] = rdf_rdfa_attributes($created_mapping, $comment->get('created')->first()->toArray());
$entity = $comment->getCommentedEntity();
// The current function is a storage level hook, so avoid to bubble
// bubbleable metadata, because it can be outside of a render context.
$comment->rdf_data['entity_uri'] = $entity->toUrl()->toString(TRUE)->getGeneratedUrl();
if (($comment->hasParentComment())&& ($comment->getParentComment())) {
$comment->rdf_data['pid_uri'] = $comment->getParentComment()->url();
}
}
}

I changed the above bold line and now its working.


Viewing all articles
Browse latest Browse all 291693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>