#89223Using columnsOnly creates a button to edit whole record.....
Description
It has been a mystery to me for years why a “Edit whole record” button is created when ‘columnsOnly’ is used as parameter in links to edit various TCA records…
In my mind; ‘columnsOnly’ should restrict the editor to ONLY see these columns…..?!?!!?
In sysext/backend/Classes/Controller/EditDocumentController.php at line 1413:
// If only SOME fields are shown in the form, this will link the user to the FULL form:
if ($this->columnsOnly) {
$columnsOnlyButton = $buttonBar->makeLinkButton()
->setHref($this->R_URI . '&columnsOnly=')
->setTitle($lang->getLL('editWholeRecord'))
->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
'actions-open',
Icon::SIZE_SMALL
));
$buttonBar->addButton($columnsOnlyButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
}
Could some sort of extra configuration be added (&disableWholeRecord=1)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
Files 1
History 13
-
Oliver Bartsch commented <span data-processor="relativetime" data-value="2020-09-04T13:17:21+00:00" > 09/04/20, 13:17 </span>
-
Benni Mack commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2020-09-04T13:50:46+00:00" > 09/04/20, 13:50 </span>Correct. This columnsOnly is to only add a specific selection of fields (possible from coming from the list module). Regarding permission this is not the way to go. Does setting proper permission solve your case? Or you could disable fields on a per-page/per-user basis with TSconfig?
-
Claus Harup commented <span data-processor="relativetime" data-value="2020-09-04T15:05:58+00:00" > 09/04/20, 15:05 </span>
The smart thing would be to add a possibility to set the parameter saying: ……&columnsOnly=title,abstract&hideEditWholeRecord=1
-
Benni Mack commented <span data-processor="relativetime" data-value="2020-09-10T12:53:33+00:00" > 09/10/20, 12:53 </span>
Claus Harup wrote:
> The smart thing would be to add a possibility to set the parameter saying: ……&columnsOnly=title,abstract&hideEditWholeRecord=1Sure, but why? This covers the visibility but people could work around that (badly) by using any other module.
-
Claus Harup commented <span data-processor="relativetime" data-value="2020-09-10T13:12:19+00:00" > 09/10/20, 13:12 </span>
Let us say I create a be module (*) and I want my editors to see a list of fe_users and ONLY want them to alter username and password – NO OTHER FIELDS!!!! :-)
(*) This module is THE ONLY module they can access when logged in.
-
Oliver Bartsch commented <span data-processor="relativetime" data-value="2020-11-02T16:12:02+00:00" > 11/02/20, 16:12 </span>
Hi, sorry for getting back to you so late.
Regarding your feedback, what about adding a backend user group for these editors only allowing them to edit the username and password field. Does this work for you?
-
Claus Harup commented <span data-processor="relativetime" data-value="2020-11-02T16:17:16+00:00" > 11/02/20, 16:17 </span>
Unforetunately no :-(
…adding &hideEditWholeRecord=1 would solve ANY variants of functionalities IMO.
Try to imagine, that you would like to create 2 be modules and in the first you would like to create a link like columnsOnly=username and in the other columnsOnly=password…. and I ONLY want these fields in the form…… – plain and simple :-)
-
Daniel Gohlke commented <span data-processor="relativetime" data-value="2024-05-17T07:17:04+00:00" > 05/17/24, 07:17 </span>
@clausharup We had an similar issue. We only want editors to be able to edit one field from a backend module. They should not have access to the other fields. This could also be regulated with corresponding access rights of the user groups, but not further restricted for a module.
In TYPO3 v12.4 and v13.1 we have used the \TYPO3\CMS\Backend\Template\Components\ModifyButtonBarEvent and removed the corresponding button before rendering in case we come from the module.
As far as I could understand, this already works in TYPO3 v11.5 with the $GLOBALS[‘TYPO3_CONF_VARS’][‘SC_OPTIONS’][‘Backend\Template\Components\ButtonBar’][‘getButtonsHook’].
The button is then located in the array in the left position and in group 7 in all TYPO3 versions mentioned.Unfortunately, we still have the problem that the Language Selector does not offer the possibility to change this, because it ignores the columnsOnly parameter. I will open a separate ticket for this and see if I can provide a patch for it.
Can the ticket be closed with this information?
-
Claus Harup commented <span data-processor="relativetime" data-value="2024-05-17T07:22:37+00:00" > 05/17/24, 07:22 </span>
Not in my opinion…. the field says: “columns Only”
I still find it odd that TYPO3 offers a button for ALL fields
-
Daniel Gohlke changed subtask #103853 <span data-processor="relativetime" data-value="2024-05-17T07:40:05+00:00" > 05/17/24, 07:40 </span>
-
Oliver Bartsch changed
subtask #103853<span data-processor="relativetime" data-value="2025-02-28T13:49:17+00:00" > 02/28/25, 13:49 </span> -
Oliver Bartsch commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2025-02-28T13:49:28+00:00" > 02/28/25, 13:49 </span>Hi Claus,
apologies for the late response. We’ve discussed the issue again and concluded that displaying the button is intended behavior in the core. The main reason for this is that the “columnsOnly” option is a display setting and should not be used for access restrictions.
However, there are events and hooks available to customize the behavior in case the default behavior does not align with your specific preferences. Therefore, I will go ahead and close the issue now. I hope this is okay with you.
Best, Oli
-
Oliver Bartsch changed Related to #103853 <span data-processor="relativetime" data-value="2025-02-28T13:49:38+00:00" > 02/28/25, 13:49 </span>
Hi,
columnsOnly is used to render records with limited fields for e.g. better overview because only some fields are needed in a specific context.
This means, columnsOnly is not the tool to restrict fields for editors. This is must be done by usergroup permissions (ACL: non_exclude_fields).
Therefore it’s valid in my eyes that the “Edit record button” gets rendered here because if permissions are set correctly the “whole record” will also be limited.