diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 84bd0d1e125ed4b256f57c2d10575e0085c07786..0ab3d8c99a0d5c6675c4ad69e5b5720aadfe21ab 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -2123,7 +2123,7 @@ function menu_contextual_links($module, $parent_path, $args) {
   $links = array();
   // Performance: In case a previous invocation for the same parent path did not
   // return any links, we immediately return here.
-  if (isset($path_empty[$parent_path])) {
+  if (isset($path_empty[$parent_path]) && strpos($parent_path, '%') !== FALSE) {
     return $links;
   }
   // Construct the item-specific parent path.
diff --git a/core/modules/contextual/contextual.info b/core/modules/contextual/contextual.info
index a006377bcade590565d639a63be4c60da954ad3c..041f2e3fffccf6df5a02c6b0188befb8768527aa 100644
--- a/core/modules/contextual/contextual.info
+++ b/core/modules/contextual/contextual.info
@@ -3,3 +3,4 @@ description = Provides contextual links to perform actions related to elements o
 package = Core
 version = VERSION
 core = 8.x
+files[] = contextual.test