TYPO3GmbH / blog

This blog extension uses TYPO3s core concepts and elements to provide a full-blown blog that users of TYPO3 can instantly understand and use.
https://typo3.com
GNU General Public License v2.0
41 stars 54 forks source link

blog modules not working after update to v10 in TYPO3 9.5.24 #184

Open medarob opened 3 years ago

medarob commented 3 years ago

Bug Report

I updated the blog extension from v9.1.2 to 10.0 and noticed the the 3 blog modules (Posts, Comments, Setup) are not working. I get an error: grafik

I haven't changed anything other than updating the extension via composer.

Prerequisites

Description

Blog modules are not working.

Steps to Reproduce

I updated the blog extension from 9.1.2 to 10.0 via composer and noticed that the blog modules were not working.

Expected behavior: blog modules work

Actual behavior: error page in BE see screenshot

Versions

ext:blog v10 and v10.0.x-dev TYPO3 9.5.24 PHP 7.4.14 MySQL 5.5.5-10.3.27-MariaDB

medarob commented 3 years ago

When I click on the Setup module:

(1/1) #1343589451 TYPO3\CMS\Core\Exception\Page\PageNotFoundException

Could not fetch page data for uid -1. in /var/www/user.dev1/public/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 262

            )
            ->execute()
            ->fetch();
        if (empty($row)) {
            throw new PageNotFoundException('Could not fetch page data for uid ' . $uid . '.', 1343589451);
        }
        $this->pageContext->versionOL('pages', $row, false, true);
        $this->pageContext->fixVersioningPid('pages', $row);
        if (is_array($row)) {

at TYPO3\CMS\Core\Utility\RootlineUtility->getRecordArray(-1) in /var/www/user.dev1/public/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 396

 * @throws CircularRootLineException
 */
protected function generateRootlineCache()
{
    $page = $this->getRecordArray($this->pageUid);
    // If the current page is a mounted (according to the MP parameter) handle the mount-point
    if ($this->isMountedPage()) {
        $mountPoint = $this->getRecordArray($this->parsedMountPointParameters[$this->pageUid]);
        $page = $this->processMountedPage($page, $mountPoint);

at TYPO3\CMS\Core\Utility\RootlineUtility->generateRootlineCache() in /var/www/user.dev1/public/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 217

    }
    if (!isset(static::$localCache[$this->cacheIdentifier])) {
        $entry = static::$cache->get($this->cacheIdentifier);
        if (!$entry) {
            $this->generateRootlineCache();
        } else {
            static::$localCache[$this->cacheIdentifier] = $entry;
            $depth = count($entry);
            // Populate the root-lines for parent pages as well

at TYPO3\CMS\Core\Utility\RootlineUtility->get() in /var/www/user.dev1/public/typo3conf/ext/blog/Classes/Service/SetupService.php line 50

                ->from('pages')
                ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($blogUid, \PDO::PARAM_INT)))
                ->execute()
                ->fetchColumn();
            $rootline = array_reverse(GeneralUtility::makeInstance(RootlineUtility::class, $blogUid)->get());
            $setups[$blogUid] = [
                'uid' => $blogUid,
                'title' => $title,
                'path' => implode(' / ', array_map(function ($page) {

at T3G\AgencyPack\Blog\Service\SetupService->determineBlogSetups() in /var/www/user.dev1/public/typo3conf/ext/blog/Classes/Controller/BackendController.php line 143

 */
public function setupWizardAction(): string
{
    return $this->render('Backend/SetupWizard.html', [
        'blogSetups' => $this->setupService->determineBlogSetups(),
    ]);
}

/**

at T3G\AgencyPack\Blog\Controller\BackendController->setupWizardAction() in /var/www/user.dev1/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php line 318

    }
    $validationResult = $this->arguments->validate();
    if (!$validationResult->hasErrors()) {
        $this->emitBeforeCallActionMethodSignal($preparedArguments);
        $actionResult = $this->{$this->actionMethodName}(...$preparedArguments);
    } else {
        $actionResult = $this->{$this->errorMethodName}();
    }

at TYPO3\CMS\Extbase\Mvc\Controller\ActionController->callActionMethod() in /var/www/user.dev1/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php line 167

    $this->view = $this->resolveView();
    if ($this->view !== null) {
        $this->initializeView($this->view);
    }
    $this->callActionMethod();
    $this->renderAssetsForRequest($request);
}

/**

at TYPO3\CMS\Extbase\Mvc\Controller\ActionController->processRequest(object(TYPO3\CMS\Extbase\Mvc\Web\Request), object(TYPO3\CMS\Extbase\Mvc\Web\Response)) in /var/www/user.dev1/public/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php line 73

            throw new \TYPO3\CMS\Extbase\Mvc\Exception\InfiniteLoopException('Could not ultimately dispatch the request after ' . $dispatchLoopCount . ' iterations. Most probably, a @' . \TYPO3\CMS\Extbase\Annotation\IgnoreValidation::class . ' annotation is missing on re-displaying a form with validation errors.', 1217839467);
        }
        $controller = $this->resolveController($request);
        try {
            $controller->processRequest($request, $response);
        } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $ignoredException) {
        }
    }
    $this->emitAfterRequestDispatchSignal($request, $response);

at TYPO3\CMS\Extbase\Mvc\Dispatcher->dispatch(object(TYPO3\CMS\Extbase\Mvc\Web\Request), object(TYPO3\CMS\Extbase\Mvc\Web\Response)) in /var/www/user.dev1/public/typo3/sysext/extbase/Classes/Mvc/Web/BackendRequestHandler.php line 35

{
    $request = $this->requestBuilder->build();
    /** @var \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response */
    $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
    $this->dispatcher->dispatch($request, $response);
    return $response;
}

/**

at TYPO3\CMS\Extbase\Mvc\Web\BackendRequestHandler->handleRequest() in /var/www/user.dev1/public/typo3/sysext/extbase/Classes/Core/Bootstrap.php line 217

    /** @var \TYPO3\CMS\Extbase\Mvc\RequestHandlerResolver $requestHandlerResolver */
    $requestHandlerResolver = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\RequestHandlerResolver::class);
    $requestHandler = $requestHandlerResolver->resolveRequestHandler();
    /** @var WebResponse $extbaseResponse */
    $extbaseResponse = $requestHandler->handleRequest();

    // Convert to PSR-7 response and hand it back to TYPO3 Core
    $response = $this->convertExtbaseResponseToPsr7Response($extbaseResponse);
    $this->resetSingletons();

at TYPO3\CMS\Extbase\Core\Bootstrap->handleBackendRequest(object(TYPO3\CMS\Core\Http\ServerRequest)) at call_user_func_array(array(object(TYPO3\CMS\Extbase\Core\Bootstrap), 'handleBackendRequest'), array(object(TYPO3\CMS\Core\Http\ServerRequest))) in /var/www/user.dev1/public/typo3/sysext/backend/Classes/Http/RouteDispatcher.php line 93

            $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/user.dev1/public/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/user.dev1/public/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/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/typo3/sysext/backend/Classes/Middleware/BackendRouteInitialization.php line 73

    // 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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:121$368->handle(object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/AbstractApplication.php line 108

{
    $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/user.dev1/public/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/user.dev1/public/typo3/sysext/core/Classes/Http/AbstractApplication.php line 120

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/user.dev1/public/typo3/index.php line 24

// Set up the application for the backend call_user_func(function () { $classLoader = require dirname(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/user.dev1/public/typo3/index.php line 25

call_user_func(function () { $classLoader = require dirname(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(); });

medarob commented 3 years ago

It seems that the issue has something to do with workspaces. We had (old) blog pages in workspaces and changing those to "deleted" seems to have fixed the problem and now the modules work. Furthermore, workspaces and ext:blog seems not to work properly because everytime someone wants to preview a blog post in workspaces this error occurs:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: An exception occurred while executing 'SELECT uid_local, uid_foreign, tablenames, fieldname, sorting, sorting_foreign, uid, pid, tstamp, crdate, cruser_id, deleted, hidden, starttime, endtime, t3ver_oid, t3ver_id, t3ver_wsid, t3ver_label, t3ver_state, t3ver_stage, t3ver_count, t3ver_tstamp, t3ver_move_id, t3_origuid, sys_language_uid, l10n_parent, l10n_diffsource, title, description, parent, items, fe_group, images, single_pid, shortcut, import_id, import_source, seo_title, seo_description, seo_headline, seo_text, content, l10n_state, posts, slug, tx_rds_uid_intranet, tx_rds_related_rootid, tx_rds_website_priority, tx_kesearch_filter, tx_kesearch_filtersubcat, record_type FROM sys_category WHERE (pid = ?) AND (t3ver_oid = ?) AND (t3ver_wsid = ?) AND (sys_category.deleted = 0) LIMIT 1' with params [-1, 245, 1]: Unknown column 'uid_local' in 'field list' | Doctrine\DBAL\Exception\InvalidFieldNameException thrown in file /var/www/user.dev/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php in line 64. Requested URL: .../typo3/index.php?route=%%2Fweb%%2Flayout%%2F&token=--AnonymizedToken--&id=1639

Seems to be this issue: https://forge.typo3.org/issues/81208 .. but that could be another issue and not related the initial one.

Not sure why the error didn't appear with blog 9.1.2.