Bug #67230

Labels not displayed for group relations in pi_base extensions

Added by Jigal van Hemert about 4 years ago. Updated over 3 years ago.

Status:
Accepted
Priority:
Must have
Assignee:
-
Category:
Backend User Interface
Start date:
2015-06-02
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

Description

https://review.typo3.org/35483 introduced a regression in 6.2.12
For fields of type "group", with "internal_type" = 'db' the labels aren't shown if only 'allowed' property is used to define the table for which the MM relation is made.

The new code assumes that 'foreign_table' is set, which is marked as "just a workaround for an extbase limitation" in TCA reference. Pi_base extension don't use that field and rely on the 'allowed' field to define the remote table. The old code worked fine for pi_base extensions, but apparently not for extbase extensions; with the new code this situation is the other way around.


Related issues

Related to TYPO3 Core - Bug #52126: Readable output for type "group" and using mm tables is wrong Closed 2013-09-19
Related to TYPO3 Core - Bug #57129: Related group db record title does not resolve correctly Closed 2014-03-21

History

#1 Updated by Jigal van Hemert about 4 years ago

  • Target version set to 6.2.13
  • Sprint Focus set to Stabilization Sprint

#2 Updated by Markus Klein about 4 years ago

Can you post a sample TCA?

https://review.typo3.org/#/c/35483/4/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
Already contains such a testcase, right?

$GLOBALS['TCA'] = array(
    'index_config' => array(
        'columns' => array(
            'indexcfgs' => array(
                'config' => array(
                    'type' => 'group',
                    'internal_type' => 'db',
                    'allowed' => 'index_config,pages',
                    'size' => 5,
                ),
            ),
        ),
    ),
);

#3 Updated by Jigal van Hemert about 4 years ago

Anonymized TCA:

        'category' => array(
            'exclude' => 1,
            'label' => 'LLL:EXT:extkey/locallang_db.xml:tx_extkey.category',
            'config' => array(
                'type' => 'group',
                'internal_type' => 'db',
                'allowed' => 'tx_extkey_cat',
                'size' => 5,
                'minitems' => 0,
                'maxitems' => 100,
                'MM' => "tx_extkey_category_mm",
            )
        ),

adding a line 'foreign_table' => 'tx_extkey_cat', makes the category labels appear in the List module.

The new unit test doesn't have an 'MM' property set. Without 'MM' a different block of code is used which looks in $theColConf['allowed'].
If you look at the new code it explicitly uses $theColConf['foreign_table'] to get the name of the linked table, whereas the old code used $theColConf['allowed'].

allowed can contain a list of tables or '*' as a wildcard, so it is rather complicated to handle them exactly list the 'foreign_table' property of a 'select' field.

Looking at the differences and the definitions in TCAref. I suspect that the previous bugfix was done for extbase extensions since extbase uses 'foreign_table' to find the table name for a 'group' field.

We could easily copy 'allowed' to 'foreign_table' if the latter is empty, but for 'group' fields the options to have multiple foreign tables or a '*' wildcard must still be supported.

#4 Updated by Markus Klein about 4 years ago

  • Status changed from New to Accepted
  • Priority changed from Should have to Must have
  • Complexity set to medium

Ok thanks, got that.

We have to add a unit test for this case and the 'allowed' and '*' has to be supported, I fully agree.

#5 Updated by Alexander Opitz about 4 years ago

  • Target version changed from 6.2.13 to 6.2.14

#6 Updated by Alexander Opitz almost 4 years ago

  • Target version changed from 6.2.14 to 6.2.15

#7 Updated by Alexander Opitz almost 4 years ago

  • Target version changed from 6.2.15 to 6.2.16

#8 Updated by Markus Klein over 3 years ago

  • Target version changed from 6.2.16 to Candidate for patchlevel

Also available in: Atom PDF