Review main Merged

19779[BUGFIX] Illegal string offset 'translations' in DatabaseRecordList

Philipp Gampe CR +2 V +2 Easy +5 −3 updated 06/15/13, 13:33

Commit message

The return value of TranslationConfigurationProvider->translationInfo
normally is an array, but it is a string in case of an error.
Move the line below the is_array() check, because it is only needed
inside.

Review

  • Code review CR +2
    • Markus Klein +2
    • Dmitry Dulepov +2
    • Alexander Opitz +1
    • Heiko Kromm +1
  • Verified V +2
    • Markus Klein +2
    • Heiko Kromm +1

Files 2

Review log 15

  1. Markus Klein commented on patch set 1 V 0 05/27/13, 17:19

    DatabaseRecordList.php:499

    Is this simply wrong here???

    DatabaseRecordList.php:506

    dead code following here, because $this->translations is always FALSE, see line 500.
  2. Markus Klein commented on patch set 1 2 comments 05/27/13, 17:19

    I would prefer that you didn't submit this Please also fix the other occurrence, or remove the dead code.
  3. Markus Klein commented on patch set 1 05/27/13, 17:19

    Looks good to me, but someone else must approve Thanks for your explanation! The "recursion" is actually a three-way call: getTable -> renderListRow -> makeLocalizationPanel
  4. Philipp Gampe commented on patch set 1 05/27/13, 17:19

    (4 inline comments) This code is just madness. Feel free to follow the whole flow and clean this method, but I just wanted to fix the PHP warning.

    DatabaseRecordList.php:499 Reply

    my first thought too, but then I debugged :|

    DatabaseRecordList.php:501

    Recursive call! The variable is set again somewhere before the execution continues.

    DatabaseRecordList.php:506 Reply

    No!!!!!! This function is called recursively! This code was definitely used while I debugged round the problem. I do not know, if the code makes sense, but please keep in mind that the code here is really sensitive to changes, because so much interaction is going on in between the calls. This code is not straightforward and not linear.

    DatabaseRecordList.php:1254

    the sole reason I set this here is to avoid breaking code I might not be aware of
  5. Mr. Jenkins commented on patch set 1 05/27/13, 17:19

  6. Stefan Galinski voted on patch set 1 V 0 05/29/13, 21:57

  7. Markus Klein uploaded patch set 2 05/29/13, 22:24

  8. Mr. Jenkins commented on patch set 2 05/29/13, 22:24

  9. Markus Klein commented on patch set 2 05/29/13, 22:25

    Verified; Looks good to me, but someone else must approve Reapplying vote after rebase for current master
  10. Alexander Opitz commented on patch set 2 05/30/13, 07:41

    Looks good to me, but someone else must approve
  11. Dmitry Dulepov commented on patch set 2 06/03/13, 18:04

    Looks good to me, approved Pretty hard to test this. Any clues how?
  12. Heiko Kromm voted on patch set 2 V +1 CR +1 06/05/13, 14:13

  13. Markus Klein commented on patch set 2 V 0 06/05/13, 14:57

    I've to remove my v+1 due to the fact that I noticed some conditions that I didn't test. Maybe this requires another code change. :-(
  14. Markus Klein commented on patch set 2 V +2 CR +2 06/05/13, 15:13

    After reading the code carefully again and grep'ing the whole core for possible usages of the member. I see no issues here. Testing is only possible by forcing translationInfo() into an error. Examples: Missing TCA, non-translatable table, etc.
  15. Philipp Gampe merged patch set 3 06/15/13, 13:33