Review main Merged

27689[BUGFIX] getLabelsFromItemsList() returns no value

Xavier Perseguers CR +2 V +2 Normal +61 −9 updated 03/04/14, 17:09

Commit message

Method getLabelsFromItemsList() is expected to return an empty list
when the column is populating items from a foreign_table configuration
option. Method getProcessedValue() is explicitly checking this to
retrieve the label from the corresponding foreign record if it could not
be resolved from the list of static items.

This reverts commits 5dd32b83e7085ed44713c9b97d5c2c47d820765e and
9596d4da3ac8110a76cb3eadabb9307b67971793 and moves the business logic
into method getProcessedValue().

Review

  • Code review CR +2
    • Helmut Hummel +2
    • Anja Leichsenring +1
    • Frans Saris +1
  • Verified V +2
    • Helmut Hummel +2
    • Anja Leichsenring +1
    • Frans Saris +1

Files 2

Review log 23

  1. Frans Saris commented on patch set 1 02/18/14, 14:20

    @Xavier I'm not sure that I understand the problem. Where can I test this to see what goes wrong? Is there no option to only use this new introduces fallback when itemsProcFunc is set?
  2. Xavier Perseguers commented on patch set 1 02/18/14, 14:58

    To test, you need something like that, in table X (e.g., "tx_concerts_dm_performance") you define a column (e.g., "location") of type "select" with items coming from table Y (e.g., "tx_concerts_dm_location") (having properties name, address, ...). Then, in ext_tables.php, you ask to show the name of the location as the alternative label: $TCA['tx_concerts_domain_model_performance'] = array( 'ctrl' => array( 'title' => '<whatever>', 'label' => 'date', 'label_alt' => 'location', 'label_alt_force' => 1, With the default behaviour you get something like "01.01.2014, New-York", with the fix from 54131, you now see "01.01.2014, 5" where 5 is the uid of location New York. I could not reproduce the "empty" label described in the associated bug report (linked to 54131) when every info was "correct" (see my comment there). So I miss a valid use case. But it sounds like you should either implement handling of itemsProcFunc (which btw, seemed to have been processed already when I tried with filemounts) but this would be a new feature and should be properly tested, if authorized at all by Ernesto as the PHP doc is relatively clear and this change has broken the old behaviour. If processing of itemsProcFunc is not really needed, then the caller should take care of returning the uid but this method returns a localized label, if no label can be found, it is normal to expect it to return something "empty" and not take on itself to return "something" anyway, furthermore when caller for foreign_table checks if it is empty to further process another way.
  3. Frans Saris commented on patch set 1 02/18/14, 17:39

    The issue is/was not the "label" but the column field when you enable/show extra columns in list view.
  4. Christian Kuhn commented on patch set 1 02/18/14, 18:33

    maybe the tests could stay and we add a regression test instead?
  5. Christian Kuhn commented on patch set 1 02/18/14, 18:35

    Related: #issue-that-introduced-regression
  6. Frans Saris commented on patch set 1 CR -2 02/18/14, 18:54

    Btw is was intented that the uid is shown when no match is found. This way it is visible that a relation is set also when the other part of the relation couldn't be resolved anymore. This was discused at the last code sprint. Will have another look at it again tomorrow evening.
  7. Xavier Perseguers commented on patch set 1 02/18/14, 19:03

    Reply

    I wanted to do that but the git check complained about missing Fixes|Resolves line
  8. Mr. Jenkins commented on patch set 1 02/18/14, 23:56

  9. Frans Saris commented on patch set 1 02/19/14, 19:50

    As BackendUtility::getLabelsFromItemsList() is only used once in core I think we should add an extra parameter to pass thru the fact that the field has a foreign_table value set or not. When set the new fallback isn't returned. What do you think?
  10. Frans Saris commented on patch set 1 02/22/14, 13:11

    An other solution would be to revert the changes in getLabelsFromItemsList() and in the switch in getProcessedValue() return the plain db value when the $l = empty.
  11. Xavier Perseguers commented on patch set 1 03/01/14, 10:25

    I still do not understand how to reproduce this problem according to the forge entry (you linked to a related issue describing this and I explained there that I could not reliably reproduce). As long as I don't understand how to properly reproduce, I cannot think of a "good" solution but reverting this change which broke previous (correct) behaviour.
  12. Frans Saris commented on patch set 1 03/01/14, 10:39

    without the patch the "Folder" column will be empty if you look at the FileMount list in the BE. List -> root page -> Filemount (set field 'Folder' visible)
  13. Xavier Perseguers commented on patch set 1 03/03/14, 09:10

    This is why I tell you that I cannot reproduce, the "Folder" is properly shown without this patch, at least in current master. To have "Folder" invisible, I have to have an invalid reference (such as when renaming a previously associated folder in fileadmin) but that sounds reasonable. So I still don't know how to reproduce this bug :)
  14. Xavier Perseguers uploaded patch set 2 03/03/14, 09:42

  15. Mr. Jenkins commented on patch set 2 03/03/14, 09:54

  16. Frans Saris commented on patch set 2 CR +1 03/03/14, 10:36

    Maybe leave the tests?
  17. Xavier Perseguers uploaded patch set 3 03/03/14, 15:24

  18. Xavier Perseguers commented on patch set 3 03/03/14, 15:25

    Adapted and kept the original unit tests
  19. Mr. Jenkins commented on patch set 3 03/03/14, 15:37

  20. Frans Saris voted on patch set 3 V +1 CR +1 03/04/14, 16:30

  21. Anja Leichsenring commented on patch set 3 V +1 CR +1 03/04/14, 17:09

    +1/+1 from me, but no merge, after I am not so sure I completely understood all the meaning.
  22. Helmut Hummel voted on patch set 3 V +2 CR +2 03/04/14, 17:09

  23. Helmut Hummel merged patch set 4 03/04/14, 17:09