1

Im working on a fresh install of Magento 2.3 and wanting to install an extension from market place.

When I try to do it via the web setup wizard I just get this error:

Fatal error: Uncaught Exception: Notice: compact(): Undefined variable: extras in /home/darkpeak/public_html/vendor/zendframework/zend-view/src/Helper/HeadLink.php on line 413 in /home/darkpeak/public_html/vendor/magento/framework/App/ErrorHandler.php:61 Stack trace: #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(8, 'compact(): Unde...', '/home/darkpeak/...', 413, Array) #1 /home/darkpeak/public_html/vendor/zendframework/zend-view/src/Helper/HeadLink.php(413): compact('rel', 'type', 'href', 'media', 'conditionalStyl...', 'extras') #2 /home/darkpeak/public_html/vendor/zendframework/zend-view/src/Helper/HeadLink.php(178): Zend\View\Helper\HeadLink->createDataStylesheet(Array) #3 /home/darkpeak/public_html/setup/view/layout/layout.phtml(16): Zend\View\Helper\HeadLink->__call('appendStyleshee...', Array) #4 /home/darkpeak/public_html/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include('/home/darkpeak/...') #5 /home/darkpeak/public_html/vendor/zendframework/zend-view/src/View.php(207) in /home/darkpeak/public_html/vendor/magento/framework/App/ErrorHandler.php on line 61

Can anyone help?

Aasim Goriya
5,4622 gold badges30 silver badges54 bronze badges
asked Dec 20, 2018 at 10:34

1 Answer 1

0

Currently Magento 2.3 does not support 7.3, and 7.3 is in its early release so it might have an issue, to solve this problem you can use the following workaround for now(Need to remove in next release or updates)

Replace this:

$attributes = compact('rel', 'type', 'href', 'media', 'conditionalStylesheet', 'extras');

With this:

$attributes = array('rel' => $rel, 'type' => $type, 'href' => $href, 'media' => $media, 'conditionalStylesheet' => $conditionalStylesheet, 'extras' => isset($extras)? $extras: '');

As per PHP document compact is now returning an error if the variable is undefined, here an $extra is undefined, compact() is a function in PHP that creates an array of values from a list of variable names. If an undefined variable is specified, the resulting array will not contain an index for that variable. This could cause some unexpected behavior due to missing indexes and some scenarios that are difficult to debug.

Starting in PHP 7.3, a notice will be triggered when an undefined variable is passed to compact() to help with identify such situations.

For more detail on this check this

answered Jan 9, 2019 at 6:45

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.