Warning (2) : Attempt to read property "has_landing_page" on null [in /var/www/code/src/Controller/CategoriesController.php, line 106]
Warning (2) : Attempt to read property "id" on null [in /var/www/code/src/Controller/CategoriesController.php, line 122]
Warning (2) : Attempt to read property "id" on null [in /var/www/code/src/Controller/CategoriesController.php, line 131]
Warning (512) : Unable to emit headers. Headers sent in file=/var/www/code/vendor/cakephp/cakephp/src/Error/Renderer/HtmlErrorRenderer.php line=37 [in /var/www/code/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 65]
Warning (2) : Cannot modify header information - headers already sent by (output started at /var/www/code/vendor/cakephp/cakephp/src/Error/Renderer/HtmlErrorRenderer.php:37) [in /var/www/code/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 159]
Warning (2) : Cannot modify header information - headers already sent by (output started at /var/www/code/vendor/cakephp/cakephp/src/Error/Renderer/HtmlErrorRenderer.php:37) [in /var/www/code/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php, line 192]
Error: Cake\ORM\Behavior\TreeBehavior::findChildren(): Argument #2 ($for) must be of type string|int, null given, called in /var/www/code/vendor/cakephp/cakephp/src/ORM/Table.php on line 2749

Cake\ORM\Behavior\TreeBehavior::findChildren(): Argument #2 ($for) must be of type string|int, null given, called in /var/www/code/vendor/cakephp/cakephp/src/ORM/Table.php on line 2749 📋

TypeError
Error in: ROOT/vendor/cakephp/cakephp/src/ORM/Behavior/TreeBehavior.php, line 448
CORE/src/ORM/Behavior/TreeBehavior.php at line 448 (edit)
     * @param bool $direct Whether to return only the direct (true) or all children (false).
     * @return \Cake\ORM\Query\SelectQuery
     * @throws \InvalidArgumentException When the 'for' key is not passed in $options
     */
    public function findChildren(SelectQuery $query, int|string $for, bool $direct = false): SelectQuery
    {
        $config = $this->getConfig();
        [$parent, $left, $right] = array_map(
            function ($field) {

If you want to customize this error message, create templates/Error/error500.php