test fixes and changes for release

This commit is contained in:
Dennis Eichhorn 2022-12-25 00:06:17 +01:00
parent 92ba086d06
commit 2373817784
3 changed files with 25 additions and 5 deletions

View File

@ -171,14 +171,15 @@ final class BackendController extends Controller
$tree[$ref][$component->getId()]['obj'] = $component;
$parent = $component->parent->getId();
if (!($component instanceof Position) // parent could be in different department then ignore
|| (!($component->parent instanceof NullPosition) && $component->parent->department->getId() === $component->department->getId())
if ($parent !== 0
&& (!($component instanceof Position) // parent could be in different department then ignore
|| $component->parent->department->getId() === $component->department->getId()
)
) {
if (!isset($tree[$ref][$parent])) {
$tree[$ref][$parent] = ['obj' => null, 'children' => [], 'index' => 0];
}
// For some stupid reason the next line is too complicated for phpstan and the error it creates is insane/wrong!
/** @phpstan-ignore-next-line */
$tree[$ref][$parent]['children'][] = &$tree[$ref][$component->getId()];
}

View File

@ -54,10 +54,10 @@ class Unit implements \JsonSerializable
/**
* Parent
*
* @var null|Unit
* @var Unit
* @since 1.0.0
*/
public ?self $parent = null;
public self $parent;
/**
* Description.

View File

@ -257,6 +257,25 @@ $CONFIG = [
'root' => '/',
'https' => false,
],
'app' => [
'path' => __DIR__,
'default' => [
'app' => 'Backend',
'id' => 'backend',
'lang' => 'en',
'theme' => 'Backend',
'org' => 1,
],
'domains' => [
'127.0.0.1' => [
'app' => 'Backend',
'id' => 'backend',
'lang' => 'en',
'theme' => 'Backend',
'org' => 1,
],
],
],
'socket' => [
'master' => [
'host' => '127.0.0.1',