Bug #87721

Attempt to insert record on page '[root-level]' (0) where this table, <table-name>, is not allowed, error while creating a new record

Added by Anu Bhuvanendran Nair 3 months ago. Updated 18 days ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2019-02-15
Due date:
% Done:

100%

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

Description

While creating a new record into a folder from the list module. There is a 'new' button along save and close, which is unnecessary at the moment unless the record is saved.
If this new button is clicked and tried to generate a new record before saving, an error 'Attempt to insert record on page '[root-level]' (0) where this table, <table-name>, is not allowed' will be triggered.

A solution workaround is, in \TYPO3\CMS\Backend\Controller\EditDocumentController a condition can be used and checked to prevent 'new' button in the 'new' cmd context.

    /**
     * Create the panel of buttons for submitting the form or otherwise perform operations.
     *
     * @param ServerRequestInterface $request
     */
    protected function getButtons(ServerRequestInterface $request): void
    {
        .....

        if($this->firstEl['cmd']!='new') {
            $this->registerNewButtonToButtonBar(
                $buttonBar,
                ButtonBar::BUTTON_POSITION_LEFT,
                4,
                $sysLanguageUid,
                $l18nParent
            );
        }

        .....
    }

list-view-new-button-bug.png View - Screenshot of the error (39.5 KB) Anu Bhuvanendran Nair, 2019-02-15 11:21

Associated revisions

Revision 84287877 (diff)
Added by Benni Mack about 1 month ago

[BUGFIX] Don't show new button when adding a new record

As there is no "pid" available, the new button on new
records should not be shown.

Resolves: #87721
Releases: master, 9.5
Change-Id: Ie3521882e38f031d3362de841351b058faed9521
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60506
Tested-by: TYPO3com <>
Tested-by: Josef Glatz <>
Tested-by: Susanne Moog <>
Reviewed-by: Josef Glatz <>
Reviewed-by: Susanne Moog <>

Revision f30e78fc (diff)
Added by Benni Mack about 1 month ago

[BUGFIX] Don't show new button when adding a new record

As there is no "pid" available, the new button on new
records should not be shown.

Resolves: #87721
Releases: master, 9.5
Change-Id: Ie3521882e38f031d3362de841351b058faed9521
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60506
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60513
Reviewed-by: Oliver Klee <>
Reviewed-by: Josef Glatz <>
Reviewed-by: Susanne Moog <>
Tested-by: Josef Glatz <>
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>

History

#1 Updated by Kevin Ditscheid 3 months ago

The problem actually is, that the New button is not respecting the PID you are on, when clicking it inside a new record.

#2 Updated by Anu Bhuvanendran Nair 3 months ago

  • Priority changed from Should have to Must have

#3 Updated by Susanne Moog 2 months ago

Hey and thanks for reporting this issue. As you seem already familiar with the code, would you mind creating a patch for it? See https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/ for a guide on how to get started.

#4 Updated by Gerrit Code Review about 1 month ago

  • Status changed from New 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/+/60506

#5 Updated by Gerrit Code Review about 1 month 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/+/60513

#6 Updated by Benni Mack about 1 month ago

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

#7 Updated by Benni Mack 18 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF