Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation: #104108 - Table dependant definition of columnsOnly #4308

Open
simonschaufi opened this issue Sep 10, 2024 · 0 comments
Open

Deprecation: #104108 - Table dependant definition of columnsOnly #4308

simonschaufi opened this issue Sep 10, 2024 · 0 comments

Comments

@simonschaufi
Copy link
Collaborator

Deprecation: #104108 - Table dependant definition of columnsOnly

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.2/Deprecation-104108-TableDependantDefinitionOfColumnsOnly.html

Deprecation: #104108 - Table dependant definition of columnsOnly

See 104108

Description

When linking to the edit form it's possible to instruct the
EditDocumentController to only render a subset of available fields for
corresponding records using the
columnsOnly functionality, by adding the
fields to be rendered as a comma-separated list.

However, besides rendering only records form a single table, the edit
form is also capable of rendering records of different tables in the
same request.

Therefore, the limit fields functionality has been extended to allow set
the fields to be rendered on a per-table basis. This means that passing
just a comma-separated list of fields as value for
columnsOnly has been deprecated.

Impact

Passing a comma-separated list of fields as value for
columnsOnly will trigger a PHP
deprecation warning. A compatibility layer will automatically set the
field list for the given tables.

Affected installations

All installations passing a comma-separated list of fields as value for
columnsOnly.

Migration

The field to be rendered have to be passed as array under the
corresponding table name.

An example, building such link using the `UriBuilder`:

$urlParameters = [
    'edit' => [
        'pages' => [
            1 => 'edit',
        ],
    ],
    'columnsOnly' => 'title,slug'
    'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(),
];

GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('record_edit', $urlParameters);

Above example has to be migrated to:

$urlParameters = [
    'edit' => [
        'pages' => [
            1 => 'edit',
        ],
    ],
    'columnsOnly' => [
        'pages' => [
            'title',
            'slug'
        ]
    ],
    'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(),
];

GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('record_edit', $urlParameters);

Additionally, when rendering records form different tables, a
configuration could look like the following:

$urlParameters = [
    'edit' => [
        'pages' => [
            1 => 'edit',
        ],
        'tt_content' => [
            2 => 'edit',
        ],
    ],
    'columnsOnly' => [
        'pages' => [
            'title',
            'slug'
        ],
        'tt_content' => [
            'header',
            'subheader'
        ]
    ],
    'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(),
];

// https:://example.com/typo3/record/edit?edit[pages][1]=edit&edit[tt_content][2]=edit&columnsOnly[pages][0]=title&columnsOnly[pages][1]=slug&columnsOnly[tt_content][0]=header&columnsOnly[tt_content][1]=subheader
$link = GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('record_edit', $urlParameters);

Backend, NotScanned, ext:backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant