Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 09c6430

Browse files
committed
Fix SonataEnhancer
1 parent ae3043b commit 09c6430

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Description/SonataEnhancer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ public function enhance(Description $description)
7878
$admin->getIdParameter() => $admin->getUrlsafeIdentifier($object),
7979
], true);
8080

81-
$linkKey = trim($code, '.)');
82-
if (array_key_exists($linkKey, self::$linkKeyMapping)) {
81+
$parts = explode('.', $code);
82+
$linkKey = end($parts);
83+
84+
if (false !== $linkKey && array_key_exists($linkKey, self::$linkKeyMapping)) {
8385
$description->set(self::$linkKeyMapping[$linkKey], $url);
8486
}
8587
}

0 commit comments

Comments
 (0)