Project

General

Profile

Actions

Bug #92788

closed

Cannot remove the "New" button in EditDocumentController

Added by Xavier Perseguers over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-11-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Working on a new feature for EXT:fal_protect, I discover that I cannot remove the "New" button in the toolbar when editing a record.

The "Delete" button can be removed via a userTS option but the "New" cannot.

Result:

Digging into the code, to understand why the "New" button doesn't appear when editing the metadata of a file in File > FileList, I found that the EditDocumentController within EXT:backend hardcoded a condition within method registerNewButtonToButtonBar:

        if (
            $this->firstEl['table'] !== 'sys_file_metadata'
            && !empty($this->firstEl['table'])
            && (

When it comes to the "Delete" button, the check is not done directly on table sys_file_metadata but a method getDisableDelete is invoked and although the check on table sys_file_metadata is present as well, it is reading a userTS option options.disableDelete (https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/UserTsconfig/Options.html#disabledelete) to let us change the behaviour.

Problems:

  • System extensions benefit from additional power in regards to user extensions
  • There is no way to at least try to remove that button except by XCLASSing the controller

Suggestion:

  • Introduce a new userTS option options.disableNew back in TYPO3 v9.

Files

new.png (28 KB) new.png Xavier Perseguers, 2020-11-07 08:10

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #87321: Edit Record: New Button cannot be disabled for EditorsClosed2019-01-03

Actions
Actions

Also available in: Atom PDF