Skip to content

Commit

Permalink
fix accessing undefined variable (see #2806)
Browse files Browse the repository at this point in the history
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes #...
| Docs PR or issue | contao/docs#...

Sigh, another one for PHP8.

Fixes 
```
Warning: Undefined array key "breadcrumb"
```
after clicking on the articles selection in the page tree because the `sorting` array does not contain `breadcrumb`.

Commits
-------

36dcf5e fix accessing undefined variable
  • Loading branch information
m-vo committed Mar 3, 2021
1 parent d4f46bc commit 247659f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/classes/Backend.php
Expand Up @@ -894,7 +894,7 @@ public static function addPagesBreadcrumb($strKey='tl_page_node')
$arrLinks = array_reverse($arrLinks);

// Insert breadcrumb menu
$GLOBALS['TL_DCA']['tl_page']['list']['sorting']['breadcrumb'] .= '
$GLOBALS['TL_DCA']['tl_page']['list']['sorting']['breadcrumb'] = ($GLOBALS['TL_DCA']['tl_page']['list']['sorting']['breadcrumb'] ?? '') . '
<nav aria-label="' . $GLOBALS['TL_LANG']['MSC']['breadcrumbMenu'] . '">
<ul id="tl_breadcrumb">
Expand Down Expand Up @@ -1068,7 +1068,7 @@ public static function addFilesBreadcrumb($strKey='tl_files_node')
$GLOBALS['TL_DCA']['tl_files']['list']['sorting']['root'] = array($strNode);

// Insert breadcrumb menu
$GLOBALS['TL_DCA']['tl_files']['list']['sorting']['breadcrumb'] .= '
$GLOBALS['TL_DCA']['tl_files']['list']['sorting']['breadcrumb'] = ($GLOBALS['TL_DCA']['tl_files']['list']['sorting']['breadcrumb'] ?? '') . '
<nav aria-label="' . $GLOBALS['TL_LANG']['MSC']['breadcrumbMenu'] . '">
<ul id="tl_breadcrumb">
Expand Down

0 comments on commit 247659f

Please sign in to comment.