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 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); } }