Feature #25113

itemsProcFunc is not taken into account while generating labels for select items in the list module

Added by Jo Hasenau over 10 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2011-02-20
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

While working with records listings in the list module you can activate different fields to be shown in the list of records of any table that is present in the current page.

Attached patch will apply the itemsProcFunc before using t3lib_BEfunc::getProcessedValueExtra to make sure the array of items matches the one that is used by the page module.

The list will show checkbox, radio and/or select fields as well and display the selected values for each record in the list.

But this display does not respect any changes to the list done by itemsProcFunc although the labels are changed when you open a record to edit it. This results in a completely different set of labels used by the list module, which can be easily triggered when using the new grid view.

While there are lots of new columns and labels available in the page module, there is still just Left, Normal, Right, Border for the values 1,0,2,3 in the list view, leaving the rest of the possible values with an empty label.
(issue imported from #M17682)


Files

17682.diff (1.49 KB) 17682.diff Administrator Admin, 2011-02-20 14:07
Cattura.PNG (26.4 KB) Cattura.PNG Riccardo De Contardi, 2019-06-27 16:01

Related issues

Related to TYPO3 Core - Feature #42457: Backend layout & page content wizardClosed2012-10-28

Actions
Related to TYPO3 Core - Bug #45833: BE List Module - issues with call to itemsProcFunc and non-selected fieldsClosed2013-02-25

Actions
Related to TYPO3 Core - Bug #50581: File-Mounts: TCA issueClosed2013-07-31

Actions
Has duplicate TYPO3 Core - Bug #25158: List module + backend layout + tt_content: column titlesClosedOliver Hader2011-02-24

Actions
Has duplicate TYPO3 Core - Bug #55166: label_alt does not work with itemsProcFuncClosed2014-01-20

Actions
Has duplicate TYPO3 Core - Bug #64851: List module backend layout column titlesRejected2015-02-04

Actions
#1

Updated by Jo Hasenau over 10 years ago

pending in core list

#2

Updated by Tomas Mrozek over 10 years ago

Patch tested and it seems to do the job. Thanks Jo!

#3

Updated by Jo Hasenau over 10 years ago

So can you give a +1 in the core list please?

#4

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/16815

#5

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16838

#6

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16838

#7

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16838

#8

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16838

#9

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at http://review.typo3.org/16917

#10

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/16815

#11

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/16920

#12

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/16921

#13

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/16921

#14

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/16920

#15

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/16815

#16

Updated by Martin Kästner over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#17

Updated by Christian Kuhn over 8 years ago

  • Status changed from Resolved to New
  • Target version deleted (0)
#18

Updated by Christian Kuhn over 8 years ago

This patch introduced regressions and is reverted in all versions for now:

We have problems with multiple extensions: For example we see warnings in list module with direct_mail and imagecycle, and ext:realty throws a db error.

Most warnings can be fixed pretty easily by making sure the first parameter ($items) is an array. In tcemain, this is ensured by initItemArray() that is called on $items before they are fed to procItem. A simple fix in list module would be:

$items = is_array($fieldSetup['config']['items']) ? $fieldSetup['config']['items'] : array();
$GLOBALS['TCA'][$table]['columns'][$field]['config']['items'] = $formEngine->procItems(
   $items,
   ...

But the realty db error is not fixed by that and digging into this leads deep into the rabbit-hole. A new patch should at least do these things (grepped from the surrounding calling code of procItem calls in tcemain):
  • config['displayCond'] must be evaluated. For example ext:realty executes the itemsProcFunc for select only, if dispalyCond "$city > 0" is true.
  • The list module does not work with select * of the database row in question, but only has the fields that are actually shown. tcemain always works with the whole $row, so list module must fetch complete row if calling itemProc(), too.
  • As far as I can see from tcemain, itemProc is only called for tca types select, radio and check. Entry methods in tcemain are the getSingleField_type* methods.
  • initItemArray() must be called before calling procItem()
  • If config = select, further additional things must be done: addSelectOptionsToItemArray(), keepItems handling, addItems handling, removeItems handling (after procItems call). They should all work and have several funny dependencies that all must be checked.

Imho the above list is definately not trivial and a real fix should probably even clean up things in tcemain before, to simplify the whole stuff for easier re-usage in list module or at other places where rows are shown.

As a result, I'll for now have to revert the patch in all versions. Furthermore, the issue is now marked as "feature" and will not be backported to stable versions again to not risk another regression again.

Would be great if someone could work on all this stuff.

#19

Updated by Christian Kuhn over 8 years ago

  • Tracker changed from Bug to Feature
#20

Updated by Ernesto Baschny over 8 years ago

Thanks for the analysis and reverting the change, Christian. I've stumbled over that bug also starting with 4.5.23.

For the record: the buggy behaviour introduced by this change started in

  • 4.5.23
  • 4.6.16
  • 4.7.8
  • 6.0.1

And will now be fixed in the next releases:

  • 4.5.26
  • 4.7.11
  • 6.0.5

Cheers,
Ernesto

#21

Updated by Christian Kuhn over 8 years ago

Thx Ernesto. Actually, I reverted this one also in 4.6, just in case we are forced to still release another 4.6 again I don't want the regression to be in there.

#22

Updated by Michael Stucki about 6 years ago

I'm currently stuck at this problem. Tried the original patch which has many flaws, as Christian already pointed out.

A solid fix for the problem would probably require additional configuration flags to enable/disable the processing for each entry, because otherwise this can likely become a performance killer.

In my case however, it would already be enough if the value is displayed as stored in the database:

                unset($GLOBALS['TCA'][$table]['columns'][$field]['config']['items']);
                unset($GLOBALS['TCA'][$table]['columns'][$field]['config']['itemsProcFunc']);
                $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] = 'text';

Does that sound acceptable as a workaround? At least it's better than an empty value, which is currently the case...

Let me know then I'll prepare a patch.

#23

Updated by Riccardo De Contardi about 5 years ago

  • Category set to Backend User Interface
#24

Updated by Susanne Moog over 3 years ago

  • Related to deleted (Bug #64851: List module backend layout column titles)
#25

Updated by Susanne Moog over 3 years ago

  • Has duplicate Bug #64851: List module backend layout column titles added
#26

Updated by Riccardo De Contardi almost 2 years ago

I tried the following test with TYPO3 9.5.8 and the latest version of gridelements

1) Install EXT:gridelements and check "Enable nesting in list module" in its configuration
2) Create a new Backend Layout item with three colPos:

  • 0 with label "Main"
  • 1 with label "Bottom"
  • 100 with label "Other"

3) Create a new CE Backend Layout with two colPos:

  • 200 with label "Left pos 200"
  • 201 with label "Right pos 201"

4) assign the BE layout to a page; create some content in it and add also a Gridelement CE; put some content in it
5) Switch to List view

Results:

  • the labels of the Backend Layout are taken ("Default", "Bottom", "Other")
  • the labels of the CE Backend layout are not shown; just "200" and "201"

See attached Cattura.PNG screenshot.

Also available in: Atom PDF