Issue Bug Under Review Regression

#110871Visibility toggle reports wrong state for live records in a workspace

Georg Tiefenbrunn 10/01/26, 11:04 updated 11/10/26, 09:48

Description

Problem

In a workspace other than LIVE, hiding a content element in the page module saves correctly, but the page module does not show it: the button stays on “Hide”, no hidden overlay appears. Only a reload shows the hidden state.

This only affects records that exist in LIVE and have no workspace version yet. Records created in the workspace and all records in LIVE update immediately.

Independently of workspaces, the icon in the element header is replaced by the generic default icon of the table (mimetypes-x-content-text for tt_content) and loses its title after every toggle, until the next reload.

Steps to reproduce

  1. Create a workspace and switch to it.
  2. Open the page module on a page with an existing content element (for example of type “Text & Images”) that has no workspace version.
  3. Click the “Hide” button of the element.

Expected: the element gets the hidden overlay, the button switches to “Unhide”.
Actual: nothing changes in the page module. The database contains a new workspace version with hidden=1, the live record stays hidden=0. After a reload the element is shown as hidden.

Additionally, in any workspace including LIVE: the element icon switches from mimetypes-x-content-text-picture to mimetypes-x-content-text and loses its title.

Cause

RecordListController::toggleRecordVisibilityAction() (AJAX route record_toggle_visibility) re-reads the record after the DataHandler run with

$row = BackendUtility::getRecord($table, $uid, $selectFields);
  1. getRecord() applies no workspace overlay. In a workspace, the DataHandler creates a new version for the live uid, but the re-read returns the unchanged live row. The response says "isVisible": true, and page-layout.js keeps the element visible.
  2. $selectFields only contains uid, pid and the hidden field (plus a few page fields for pages). The type field (ctrl.typeicon_column, CType for tt_content), the enable columns and the version fields are missing, so IconFactory::getIconForRecord() falls back to the default icon and the overlay is computed from incomplete data. The rendered icon also carries no title, unlike the icon the page module renders in GridColumnItem.

The page module calls this endpoint since #109498 (change 93551, “Avoid reloading on visibility-toggle of content element”). Before that, the toggle triggered a full reload through tce_db, which rendered the workspace state correctly and hid the wrong response. The same endpoint is used by recordlist.js (Records module) and inline-control-container.js (FormEngine inline records), so both are affected the same way.

Proposed fix

$row = BackendUtility::getRecordWSOL($table, $uid);
if ($row !== null) {
    $recordIcon = $this->iconFactory->getIconForRecord($table, $row, IconSize::SMALL)
        ->setTitle(BackendUtility::getRecordIconAltText($row, $table, false));

    $response['icon'] = $recordIcon->render();
    $response['isVisible'] = (int)$row[$hiddenField] === 0;
}

This replaces the $selectFields block. Reading the full row is a single record lookup, and the title matches what GridColumnItem and DatabaseRecordList set.

Verified on 14.3.7 with functional tests. Without the change, “hide a live record in a workspace” reports isVisible: true and “icon keeps type and title” gets mimetypes-x-content-text; with the change both pass. “Show it again” and “hide in LIVE” pass in both cases and guard against regressions. A patch against main with a functional test will follow on Gerrit (Releases: main, 14.3).

Reviews 1

History 13