Project

General

Profile

Actions

Bug #88642

closed

Can't create record in sysfolder

Added by Ilya Smirnoff almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Start date:
2019-06-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
sysfolder records
Complexity:
hard
Is Regression:
Sprint Focus:

Description

Hi all.
I can't create records in sysfolders.
TYPO3 9.5.7
PHP Version 7.2.19
For reproduce an error I select:
List, existing sysfolder in tree, plus icon (create new record) on top of page.
After this I see en exception - see screen or text below:

(1/1) TypeError
strpos() expects parameter 1 to be string, null given

in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Controller/NewRecordController.php line 715
                            $thisTitle = '';
                            $_EXTKEY = '';
                            if ($nameParts[0] === 'tx' || $nameParts[0] === 'tt') {
                                // Try to extract extension name
                                if (strpos($v['ctrl']['title'], 'LLL:EXT:') === 0) {
                                    $_EXTKEY = substr($v['ctrl']['title'], 8);
                                    $_EXTKEY = substr($_EXTKEY, 0, strpos($_EXTKEY, '/'));
                                    if ($_EXTKEY !== '') {
                                        // First try to get localisation of extension title
at strpos(null, 'LLL:EXT:')
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Controller/NewRecordController.php line 715
                            $thisTitle = '';
                            $_EXTKEY = '';
                            if ($nameParts[0] === 'tx' || $nameParts[0] === 'tt') {
                                // Try to extract extension name
                                if (strpos($v['ctrl']['title'], 'LLL:EXT:') === 0) {
                                    $_EXTKEY = substr($v['ctrl']['title'], 8);
                                    $_EXTKEY = substr($_EXTKEY, 0, strpos($_EXTKEY, '/'));
                                    if ($_EXTKEY !== '') {
                                        // First try to get localisation of extension title
at TYPO3\CMS\Backend\Controller\NewRecordController->renderNewRecordControls(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Controller/NewRecordController.php line 439
            $this->moduleTemplate->setTitle($title);
            // GENERATE the HTML-output depending on mode (pagesOnly is the page wizard)
            // Regular new element:
            if (!$this->pagesOnly) {
                $this->renderNewRecordControls($request);
            } elseif ($this->isRecordCreationAllowedForTable('pages')) {
                // Pages only wizard
                $response = $this->renderPositionTree();

at TYPO3\CMS\Backend\Controller\NewRecordController->renderContent(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Controller/NewRecordController.php line 218
     * @return ResponseInterface the response with the content
     */
    public function mainAction(ServerRequestInterface $request): ResponseInterface
    {
        $response = $this->renderContent($request);

        if (empty($response)) {
            $response = new HtmlResponse($this->moduleTemplate->renderContent());
        }
at TYPO3\CMS\Backend\Controller\NewRecordController->mainAction(object(TYPO3\CMS\Core\Http\ServerRequest))
at call_user_func_array(array(object(TYPO3\CMS\Backend\Controller\NewRecordController), 'mainAction'), array(object(TYPO3\CMS\Core\Http\ServerRequest)))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Http/RouteDispatcher.php line 87
                $arguments[] = $response;
            }
        }

        return call_user_func_array($target, $arguments);
    }

    /**
     * Wrapper method for static form protection utility
at TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch(object(TYPO3\CMS\Core\Http\ServerRequest), object(TYPO3\CMS\Core\Http\Response))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Http/RequestHandler.php line 73
        }
        try {
            // Check if the router has the available route and dispatch.
            $dispatcher = GeneralUtility::makeInstance(RouteDispatcher::class);
            return $dispatcher->dispatch($request, $response);
        } catch (InvalidRequestTokenException $e) {
            // When token was invalid redirect to login
            $url = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir;
            return new RedirectResponse($url);
at TYPO3\CMS\Backend\Http\RequestHandler->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/SiteResolver.php line 59
            $site = GeneralUtility::makeInstance(SiteMatcher::class)->matchByPageId($pageId, $rootLine);
            $request = $request->withAttribute('site', $site);
            $GLOBALS['TYPO3_REQUEST'] = $request;
        }
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\SiteResolver->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(TYPO3\CMS\Backend\Http\RequestHandler))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/AdditionalResponseHeaders.php line 39
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $response = $handler->handle($request);
        foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['HTTP']['Response']['Headers'] ?? [] as $header) {
            [$headerName, $value] = explode(':', $header, 2);
            $response = $response->withAddedHeader($headerName, trim($value));
        }
at TYPO3\CMS\Backend\Middleware\AdditionalResponseHeaders->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/OutputCompression.php line 45
        ob_clean();
        // Initialize output compression if configured
        $this->initializeOutputCompression();

        return $handler->handle($request);
    }

    /**
     * Initialize output compression if configured
at TYPO3\CMS\Backend\Middleware\OutputCompression->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/LegacyBackendTemplateInitialization.php line 42
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $GLOBALS['TBE_TEMPLATE'] = GeneralUtility::makeInstance(DocumentTemplate::class);
        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\LegacyBackendTemplateInitialization->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/BackendUserAuthenticator.php line 70
        Bootstrap::initializeLanguageObject();
        // Register the backend user as aspect
        $this->setBackendUserAspect(GeneralUtility::makeInstance(Context::class), $GLOBALS['BE_USER']);

        return $handler->handle($request);
    }

    /**
     * Check if the user is required for the request
at TYPO3\CMS\Backend\Middleware\BackendUserAuthenticator->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/BackendRouteInitialization.php line 72

        // Add the route path to the request
        $request = $request->withAttribute('routePath', $pathToRoute);

        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\BackendRouteInitialization->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/ForcedHttpsBackendRedirector.php line 53
            list($server, $address) = explode('/', $url, 2);
            return new RedirectResponse('https://' . $server . $sslPortSuffix . '/' . $address);
        }

        return $handler->handle($request);
    }
}
at TYPO3\CMS\Backend\Middleware\ForcedHttpsBackendRedirector->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Middleware/LockedBackendGuard.php line 71
            $request->getAttribute('normalizedParams')->getRemoteAddress(),
            trim((string)$GLOBALS['TYPO3_CONF_VARS']['BE']['IPmaskList'])
        );

        return $handler->handle($request);
    }

    /**
     * Check adminOnly configuration variable and redirects to an URL in file typo3conf/LOCK_BACKEND
at TYPO3\CMS\Backend\Middleware\LockedBackendGuard->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php line 58
        // refactored to have ServerRequest object available where it is needed. This global will be
        // deprecated then and removed.
        $GLOBALS['TYPO3_REQUEST'] = $request;

        return $handler->handle($request);
    }
}
at TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute->process(object(TYPO3\CMS\Core\Http\ServerRequest), object(class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 138

                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
at class@anonymous/var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php0x7f7809290056->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php line 67
     * @return ResponseInterface
     */
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->tip->handle($request);
    }

    /**
     * Seed the middleware stack with the inner request handler
at TYPO3\CMS\Core\Http\MiddlewareDispatcher->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/AbstractApplication.php line 98
    {
        $requestHandler = GeneralUtility::makeInstance($this->requestHandler);
        $dispatcher = $this->createMiddlewareDispatcher($requestHandler);

        return $dispatcher->handle($request);
    }

    /**
     * Set up the application and shut it down afterwards
at TYPO3\CMS\Core\Http\AbstractApplication->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/backend/Classes/Http/Application.php line 68
            return $this->installToolRedirect();
        }
        // Set up the initial context
        $this->initializeContext();
        return parent::handle($request);
    }

    /**
     * Check if LocalConfiguration.php and PackageStates.php exist
at TYPO3\CMS\Backend\Http\Application->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /var/www/html/typo3_src-9.5.7/typo3/sysext/core/Classes/Http/AbstractApplication.php line 110
    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }
at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /var/www/html/typo3_src-9.5.7/typo3/index.php line 24
// Set up the application for the backend
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});
at {closure}()
in /var/www/html/typo3_src-9.5.7/typo3/index.php line 25
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});

PS Tested on other server with 9.5.5 and other TYPO3 instance - same error


Files

9.5.7.jpg (139 KB) 9.5.7.jpg Ilya Smirnoff, 2019-06-27 18:04
Actions #1

Updated by Andreas Kienast almost 5 years ago

  • Status changed from New to Needs Feedback

It seems some TCA is invalid and has no ctrl/title attribute. Can you please check that, since I fail to reproduce this issue.

Actions #2

Updated by Ilya Smirnoff almost 5 years ago

Thanks for reply.
Could you explain what exactly I need to check?
TCA of what extension you mean?
Problem is exist on my new project with 9.5.7 and on project of my colleague - 9.5.5 where I just test this bug.
I can show you list of installed extensions or I can uninstall extensions for test...

Actions #3

Updated by Georg Ringer almost 5 years ago

  • Status changed from Needs Feedback to Accepted

to reproduce that on latest master: in typo3conf/ext/styleguide/Configuration/TCA/tx_styleguide_inline_1n1n_child.php outcomment the title definition.

This is certainly a bug in the extension which provides the tca but core still should not fail

Actions #4

Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61165

Actions #5

Updated by Ilya Smirnoff almost 5 years ago

Georg Ringer wrote:

This is certainly a bug in the extension which provides the tca but core still should not fail

Exactly! )
Thanks for explanation, I will check TCA in installed extensions and try to find problems

Actions #6

Updated by Ilya Smirnoff almost 5 years ago

Gerrit Code Review wrote:

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61165

Thanks.
It's work like a charm!

Actions #7

Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61165

Actions #8

Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61165

Actions #9

Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61255

Actions #10

Updated by Georg Ringer almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF