Issue Bug Closed

#36660TCA type-field and required fields bypass

Viktor Livakivskyi 04/27/12, 14:57 updated 11/20/26, 20:20

Description

I’m using a TCA type-feature, when some table contains so called “type-field”,
which defines different views of same record at BE.

Let’s see following cases of type-switching:
1. Record is already existing, field is required and it’s content was changed
– switching type saves the field and reloads the form;
2. Record is already existing, field is required and it’s content was set to empty
– switching type doesn’t save the field, reloads the form and restores previous field’s value;
3. Record is new, field is required, and it’s content is set to something
– switching type saves the record with field’s value and reloads the form;
4. Record is new, field is required, but not filled with anything
– switching type saves the record with empty required field.

As you see, we have a problem in item 4, since user can bypass a required field validation, and it may break a logic of application, which requires some fields to be filled with something.

Reviews 1

History 1183

Show 958 earlier messages
  1. Björn Pedersen commented <span data-processor="relativetime" data-value="2012-04-30T07:08:17+00:00" > 04/30/12, 07:08 </span>

    Yes, the saving during switching is sometimes a problem. One idea would be to create a temporary versioned record and automatically switch that record oce a real save is done.

  2. Mathias Schreiber commented and changed status New Needs Feedback assigned to Mathias Schreiber <span data-processor="relativetime" data-value="2015-10-23T23:06:50+00:00" > 10/23/15, 23:06 </span>

    This is pretty hard to implement (if not impossible).

    Reasoning is that you could have two types with different sets of required fields.

    But: Would it be sufficient if we denied switching a type field until all mandatory fields have been filled in?

  3. Viktor Livakivskyi commented <span data-processor="relativetime" data-value="2015-10-26T12:10:55+00:00" > 10/26/15, 12:10 </span>

    Would it be sufficient if we denied switching a type field until all mandatory fields have been filled in?

    It can be applied as a workaround, if there is no way to not store a record, when type switches.

    The only downside I see here: user accidentally chose wrong type with lot of required fields. So, to select a correct type, he needs to fill all these fields with some dummy data to be able to switch.

  4. Alexander Opitz changed status Needs Feedback New removed the assignee <span data-processor="relativetime" data-value="2016-05-02T10:58:31+00:00" > 05/02/16, 10:58 </span>

  5. Jan Kornblum commented and changed TYPO3 Version 4.7 10 PHP Version 5.3 7.2 <span data-processor="relativetime" data-value="2021-03-04T22:00:46+00:00" > 03/04/21, 22:00 </span>

    Still a problem, especially when working with single table inhertiance.

    +1 for the workaround from matthias schreiber.

    Another workaround might be: Highlight (warning) “invalid” records in “weblist” module. So the editors at least can easily identify invalid records.

  6. Gerrit Code Review pushed patch set 27 for main to change 97304 status New Under Review <span data-processor="relativetime" data-value="2026-11-04T11:14:44+00:00" > 11/04/26, 11:14 </span>

  1. Georg Ringer commented and changed status Under Review Closed <span data-processor="relativetime" data-value="2026-11-20T20:20:21+00:00" > 11/20/26, 20:20 </span>

    might be solve with #111338, therefore closing it here