Bug #86612

Impossible to add/create new pages on PostgreSQL environment through some of the menus

Added by Damir Andrašević 8 days ago. Updated 7 days ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2018-10-09
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
postgresql
Complexity:
Is Regression:
Sprint Focus:

Description

Hi all,

I've been working with TYPO3 v8 and would like firstly to thank everyone for this awesome work.

I've been mainly focusing on Postgre installations (due to business needs in my company) and tried to migrate one installation from v8 to v9. The migration went without problems and everything is solid.

Problem occurs when user tries to create or add a new page in the Backend via right click menu in the page tree with the New page option (Page and List module) or through the List module under Page view.

Only way I managed to add new pages via drag&drop interface in the page tree.

Existing pages (added in the v8 installation) have been successfully migrated, but no new pages can be added in described way. Tried the fresh TYPO3 v9 installation and the same thing occurs.

The error displayed is:

An exception occurred while executing 'SELECT "s"."uid", "s"."pid", "s"."hidden", "s"."title", "s"."flag" FROM "sys_language" "s", "pages" "o" WHERE ("o"."sys_language_uid" = "s"."uid") AND ("o"."l10n_parent" = ?) AND (("o"."deleted" = 0) AND (("o"."t3ver_wsid" = 0) OR ("o"."t3ver_state" <= 0))) GROUP BY "s"."uid", "s"."pid", "s"."hidden", "s"."title", "s"."flag", "s"."sorting" ORDER BY "s"."sorting" ASC' with params ["NEW5bbd037e1f6e2950384548"]: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "NEW5bbd037e1f6e2950384548"

The system used to run v8 and v9 is the same.

Server configurations are:
Apache/2.4.29
PHP/7.2
PostgreSQL/10.5

By the error dump, it seems to me as if temporary page uid is not converted to the real uid, the query looks like one that is created with the query beginning on the line 634 of

./typo3/sysext/recordlist/Classes/RecordList.php

but that is as far as I've gotten for now (given my still low knowledge of TYPO3 core files). And not really sure if I'm looking at the right direction as it seems it's only connected to the specific menus.

will-add-page.png View (15.4 KB) Damir Andrašević, 2018-10-09 22:54

will-not-add-page.png View (35.4 KB) Damir Andrašević, 2018-10-09 22:54

History

#1 Updated by Josef Glatz 8 days ago

  • Priority changed from Could have to Must have

PSQL is sofficially upported. I‘ve changed therefore to Must have

#2 Updated by Damir Andrašević 7 days ago

Damir Andrašević wrote:

By the error dump, it seems to me as if temporary page uid is not converted to the real uid, the query looks like one that is created with the query beginning on the line 634 of

[...]

but that is as far as I've gotten for now (given my still low knowledge of TYPO3 core files). And not really sure if I'm looking at the right direction as it seems it's only connected to the specific menus.

Scratch this and sorry for the mislead. I was on the wrong track there, used the right grep now and with a little help of debug utility found the right one...

The main culprit is in the file:

./typo3/sysext/backend/Classes/Controller/EditDocumentController.php

specifically, the lines starting on line number 1752:

      if ($id) {
            $queryBuilder->getRestrictions()
                ->removeAll()
                ->add(GeneralUtility::makeInstance(DeletedRestriction::class))
                ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));

            if (!$this->getBackendUser()->isAdmin()) {
                $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(HiddenRestriction::class));
            }

Changing this to (for new page it will return null and thus not enter/execute the loop/query):

      if ($tce->substNEWwithIDs[$id]) {
...

makes the create new page work like intended.

Not sure if this solution is the best practice, so feel free to make any correction(s) necessary.

Also available in: Atom PDF