46117[BUGFIX] Prevent PHP error in DatabaseTreeDataProvider
Commit message
Review
-
Code review CR -1
- Frank Nägler +2
- Oliver Klee -1
- Richard Haeser +1
- Andreas Kienast +1
- Morton Jonuschat +1
-
Verified V +2
- Frank Nägler +2
- Andreas Kienast +1
- Morton Jonuschat +1
Issues 1
Files 1
Review log 10
-
Wouter Wolters uploaded patch set 1 01/20/16, 20:13
-
Richard Haeser voted on patch set 1 CR +1 01/20/16, 21:02
-
Andreas Kienast voted on patch set 1 CR +1 V +1 01/21/16, 09:58
-
Oliver Klee commented on patch set 1 CR -1 01/21/16, 10:02
-
Morton Jonuschat commented on patch set 1 CR +1 V +1 01/21/16, 10:07
DatabaseTreeDataProvider.php:457ReplyAs exec_SELECTgetRows returns either NULL or an array the empty() check avoids the PHP warning and communicates the intent clearly enough (IMHO). That foreach on an empty array is a noop means that the code just returns a bit earlier. -
Frank Nägler commented on patch set 1 CR +2 V +2 01/23/16, 21:02
The patch is valid, and as Morton said, the check is ok. We use this kind of check along the core multiple times. @Oliver: please re-think your vote, I would like to merge this bugfix before our next 7.6 release, thx -
Gerrit merged patch set 1 01/24/16, 11:36
-
Sascha Egerer commented on patch set 2 01/24/16, 11:39
DatabaseTreeDataProvider.php:457ReplyWhy not simply cast the result of exec_SELECTgetRows to an array? That would result in an empty array and the !empty check is not required anymore -
Sascha Egerer commented on patch set 2 01/24/16, 11:40
Sorry submitted the patch by an accident ;-) But coreteam is fine with the merge as it has a +2 anyway... -
Wouter Wolters commented on patch set 2 01/24/16, 12:40
Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit 3f04f731613db4a8ae65abab63cdd5e664f2b99f
DatabaseTreeDataProvider.php:457