From ae3043b7af03445bc990f86d9b3733d16de98228 Mon Sep 17 00:00:00 2001 From: Emmanuel Vella Date: Wed, 8 Jan 2020 11:03:45 +0100 Subject: [PATCH 1/2] Fix composer install memory limit error --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9bd7838..fca2a85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ before_install: - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) -install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS +install: COMPOSER_MEMORY_LIMIT=-1 travis_wait composer update --prefer-dist $COMPOSER_FLAGS script: - if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi From 09c6430b5b172c57edbea2df144e25f5d66515e8 Mon Sep 17 00:00:00 2001 From: Emmanuel Vella Date: Wed, 8 Jan 2020 10:56:28 +0100 Subject: [PATCH 2/2] Fix SonataEnhancer --- src/Description/SonataEnhancer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Description/SonataEnhancer.php b/src/Description/SonataEnhancer.php index 38cff19..44368df 100644 --- a/src/Description/SonataEnhancer.php +++ b/src/Description/SonataEnhancer.php @@ -78,8 +78,10 @@ public function enhance(Description $description) $admin->getIdParameter() => $admin->getUrlsafeIdentifier($object), ], true); - $linkKey = trim($code, '.)'); - if (array_key_exists($linkKey, self::$linkKeyMapping)) { + $parts = explode('.', $code); + $linkKey = end($parts); + + if (false !== $linkKey && array_key_exists($linkKey, self::$linkKeyMapping)) { $description->set(self::$linkKeyMapping[$linkKey], $url); } }