New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check $sfRouter before using it #10696

merged 1 commit into from Oct 3, 2018


None yet
5 participants

Quetzacoalt91 commented Sep 25, 2018

Questions Answers
Branch? 1.7.5.x
Description? $sfRouter is sometimes undefined
Type? bug fix
Category? CO
BC breaks? Nope
Deprecations? Nope
Fixed ticket? /
How to test? When installed from cli, pshomeslider must work.
PHP Notice:  Undefined variable: sfRouter in /workspace/core/classes/Link.php on line 815
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to LinkCore::searchRouteFromRouter() must implement interface Symfony\Component\Routing\RouterInterface, null given, called in /workspace/core/classes/Link.php on line 815 and defined in /workspace/core/classes/Link.php:835
Stack trace:
#0 /workspace/core/classes/Link.php(815): LinkCore->searchRouteFromRouter(NULL, 'AdminAjaxPsHome...')
#1 /workspace/core/modules/pshomeslider/pshomeslider.php(48): LinkCore->getAdminLink('AdminAjaxPsHome...')
#2 [internal function]: Pshomeslider->__construct()
#3 /workspace/core/src/Core/Foundation/IoC/Container.php(130): ReflectionClass->newInstance()
#4 /workspace/core/src/Core/Foundation/IoC/Container.php(163): PrestaShop\PrestaShop\Core\Foundation\IoC\Container->makeInstanceFromClassName('pshomeslider', Array)
#5 /workspace/core/src/Core/Foundation/IoC/Container.php(176): PrestaShop\PrestaShop\Core\Foundation\IoC\Container->doMake('pshomeslider', Array)
#6 /workspace/core/src/Adapter/ServiceLocator.php(65): PrestaShop\PrestaShop\Core\F in /workspace/core/classes/Link.php on line 835

This change is Reviewable

@Quetzacoalt91 Quetzacoalt91 added this to the milestone Sep 25, 2018

@Quetzacoalt91 Quetzacoalt91 requested a review from jolelievre Sep 25, 2018


nice catch @Quetzacoalt91 Sorry I missed it

@marionf marionf added QA ✔️ and removed waiting for QA labels Oct 2, 2018

@Quetzacoalt91 Quetzacoalt91 merged commit e49a6d4 into PrestaShop:1.7.5.x Oct 3, 2018

1 of 2 checks passed

Codacy/PR Quality Review Codacy was unable to analyse your pull request.
continuous-integration/travis-ci/pr The Travis CI build passed

@Quetzacoalt91 Quetzacoalt91 deleted the Quetzacoalt91:sfRouter branch Oct 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment