Skip to content

Commit

Permalink
Fix #16973 - Undefined array key "n0_pos2_name" and not working pos3
Browse files Browse the repository at this point in the history
This also fixes a bug introduced in: 52fcbdf
9 years ago, I tried hard to understand how it is used but for now I could not figure out.
This is now back to working code for the pos3 if.

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Jul 19, 2021
1 parent a9cfb1e commit e0adc6c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions libraries/classes/Navigation/NavigationTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ public function __construct($template, DatabaseInterface $dbi)
$this->aPath[$count] = $this->parsePath(
$_POST['n' . $count . '_aPath']
);
$index = 'n' . $count . '_pos2_';
$this->pos2Name[$count] = $_POST[$index . 'name'];
$this->pos2Value[$count] = (int) $_POST[$index . 'value'];
$index = 'n' . $count . '_pos3_';
if (isset($_POST[$index])) {
$this->pos3Name[$count] = $_POST[$index . 'name'];
$this->pos3Value[$count] = (int) $_POST[$index . 'value'];
if (isset($_POST['n' . $count . '_pos2_name'])) {
$this->pos2Name[$count] = $_POST['n' . $count . '_pos2_name'];
$this->pos2Value[$count] = (int) $_POST['n' . $count . '_pos2_value'];
}
if (isset($_POST['n' . $count . '_pos3_name'])) {
$this->pos3Name[$count] = $_POST['n' . $count . '_pos3_name'];
$this->pos3Value[$count] = (int) $_POST['n' . $count . '_pos3_value'];
}
$count++;
}
Expand Down

0 comments on commit e0adc6c

Please sign in to comment.