From a36899ca607b4421574883c088eb2220abbdaa5d Mon Sep 17 00:00:00 2001
From: HamzaDwaya <hamza@sprintive.com>
Date: Tue, 8 Oct 2024 11:21:40 +0300
Subject: [PATCH] Issue #3479296 by hamzadwaya: Dynamic Code For All Entity
 Except block_content Entity

---
 revert_default_perm.module | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/revert_default_perm.module b/revert_default_perm.module
index 24ee1c9..2af9fd4 100644
--- a/revert_default_perm.module
+++ b/revert_default_perm.module
@@ -21,9 +21,7 @@ function revert_default_perm_form_alter(&$form, &$form_state, $form_id) {
     // Check if the entity has a canonical route.
     $route_provider = \Drupal::service('router.route_provider');
     $canonical = $route_provider->getRoutesByNames(["entity.{$bundle_of}.canonical"]);
-    // If there is no canonical route, ignore.
-    // Also, we exclude block_content entities, becuase it has a canonical link, but it is used to edit
-    // the entity instead of it being a normal landing page.
+    // Check if the entity has a canonical route and does not block content.
     if (empty($canonical) || $bundle_of == "block_content") {
       return;
     }
-- 
GitLab