Skip to content
Snippets Groups Projects
Commit ec73fdbc authored by Andrii Chyrskyi's avatar Andrii Chyrskyi
Browse files

Merge pull request #2908 from...

Merge pull request #2908 from goalgorilla/issue/3276411-SocialCommentBreadcrumbBuilder_causes_an_error_loading_entities

Issue #3276411 by tarikflz, Ressinel: SocialCommentBreadcrumbBuilder causes an error loading entities
parent 0589a02d
Branches
Tags
No related merge requests found
......@@ -2,6 +2,7 @@
namespace Drupal\social_comment;
use Drupal\comment\CommentInterface;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Entity\EntityTypeManagerInterface;
......@@ -62,7 +63,9 @@ class SocialCommentBreadcrumbBuilder implements BreadcrumbBuilderInterface {
case 'comment.reply':
$page_title = $this->t('Reply to Comment');
$pid = $route_match->getParameter('pid');
$comment = $this->storage->load($pid);
if ($pid) {
$comment = $this->storage->load($pid);
}
break;
case 'entity.comment.edit_form':
......@@ -92,7 +95,10 @@ class SocialCommentBreadcrumbBuilder implements BreadcrumbBuilderInterface {
}
// Add Caching.
if ($comment) {
if (
isset($comment) &&
$comment instanceof CommentInterface
) {
$breadcrumb->addCacheableDependency($comment);
}
......
......@@ -5675,11 +5675,6 @@ parameters:
count: 1
path: modules/social_features/social_comment/src/Routing/RouteSubscriber.php
 
-
message: "#^Variable \\$comment might not be defined\\.$#"
count: 1
path: modules/social_features/social_comment/src/SocialCommentBreadcrumbBuilder.php
-
message: "#^Parameter \\#3 \\$mode of method Drupal\\\\comment\\\\CommentStorage\\:\\:loadThread\\(\\) expects int, string given\\.$#"
count: 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment