Skip to content

Commit

Permalink
[TASK] #102108 - Remove obscure TCA [types][bitmask_*] settings (#796)
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml authored Oct 10, 2023
1 parent 5a097a0 commit 5218811
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 58 deletions.
21 changes: 10 additions & 11 deletions Documentation/Types/Properties/BitmaskExcludelistBits.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
.. include:: /Includes.rst.txt
.. _types-properties-bitmask-excludelist-bits:
:orphan:

.. include:: /Includes.rst.txt
.. _types-properties-bitmask-excludelist-bits:

==========================
bitmask\_excludelist\_bits
==========================

.. confval:: bitmask_excludelist_bits

:Path: $GLOBALS['TCA'][$table]['types'][$type]
:type: array


See :ref:`bitmask\_value\_field <types-properties-bitmask-value-field>`.
.. versionchanged:: 13.0
This setting has been removed, it is not considered anymore when rendering
records in the backend record editing interface.

Syntax:
"[+/-][bit-number]" => "[comma-separated list of fields (from the main types-config) excluded]"
In case, extensions still use this setting, they should switch to casual
:php:`$GLOBALS['TCA']['someTable']['ctrl']['type']` fields instead, which
can be powered by columns based on string values.
47 changes: 10 additions & 37 deletions Documentation/Types/Properties/BitmaskValueField.rst
Original file line number Diff line number Diff line change
@@ -1,43 +1,16 @@
.. include:: /Includes.rst.txt
.. _types-properties-bitmask-value-field:
:orphan:

.. include:: /Includes.rst.txt
.. _types-properties-bitmask-value-field:

=====================
bitmask\_value\_field
=====================

.. confval:: bitmask_value_field

:Path: $GLOBALS['TCA'][$table]['types'][$type]
:type: string (field name)


Field name, which holds a value being the integer (bit-mask) for the 'bitmask\_excludelist\_bits' array.

It works much like 'subtype\_value\_field' but excludes fields based on whether a bit from the value field is set.
See property :ref:`bitmask\_excludelist\_bits <types-properties-bitmask-excludelist-bits>`.

These two properties are rarely used, but pretty powerful if a 'type=radio' or 'type=check' field
is set as bitmask\_value\_field.

[+/-] indicates whether the bit [bit-number] is set or not.

Example
=======

.. code-block:: php
'types' => [
'aType' => [
'showitem' => 'aField, anotherField, yetAnotherField',
'bitmask_value_field' => 'theSubtypeValueField',
'bitmask_excludelist_bits' => [
'-1' => 'anotherField', // Remove if bit 1 is NOT set
'+2' => 'yetAnotherField', // Remove if bit 2 is set
],
],
],
.. versionchanged:: 13.0
This setting has been removed, it is not considered anymore when rendering
records in the backend record editing interface.

With the above configuration, if field database "theSubtypeValueField" is set to value 5 (binary representation
"1 0 1"), the fields "anotherField" (-1 = 0 at bit position 1) and "yetAnotherField" (+2 = 1 at bit position 2)
are not displayed, thus leaving only field "aField". If the value is 1 (binary representation "0 0 1"), fields
"aField" and "yetAnotherField" are shown, while "anotherField" is not.
In case, extensions still use this setting, they should switch to casual
:php:`$GLOBALS['TCA']['someTable']['ctrl']['type']` fields instead, which
can be powered by columns based on string values.
17 changes: 7 additions & 10 deletions Documentation/Types/Properties/Index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
.. include:: /Includes.rst.txt
.. include:: /Includes.rst.txt

==========
Properties
==========


.. toctree::

BitmaskExcludelistBits
BitmaskValueField
ColumnsOverrides
Showitem
SubtypeValueField
SubtypesAddlist
SubtypesExcludelist
.. toctree::

ColumnsOverrides
Showitem
SubtypeValueField
SubtypesAddlist
SubtypesExcludelist

0 comments on commit 5218811

Please sign in to comment.