71421[BUGFIX] Fix unknown keys in arrays
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Oliver Klee +1
- crell +1
- Nikita Hovratov +1
-
Verified V +2 Done
- Benni Mack +2
- Nikita Hovratov +1
- core-ci +1 CI
Issues 1
Files 2
Review log 3944
Show 1619 earlier messages
-
Mathias Bolt Lesniak uploaded patch set 1 10/03/21, 17:28
-
Simon Schaufelberger commented on patch set 1 10/03/21, 17:37
-
Stefan Bürk commented on patch set 1 10/03/21, 17:42
AbstractMenuContentObject.php:266Why not simply use ?? 0 like: ``` $this->id = (int)($this->tmpl->rootLine[$this->entryLevel]['uid'] ?? 0); ``` -
Simon Gilli commented on patch set 1 10/03/21, 17:43
ContentContentObject.php:116ReplyShould be `$conf['select.']['pidInList'] ?? ''` because getSlidePids expects a string here. -
core-ci voted on patch set 1 V +1 10/03/21, 17:43 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17518
-
Stefan Bürk uploaded patch set 2 10/04/21, 03:02
-
Stefan Bürk commented on patch set 2 10/04/21, 03:02
ContentContentObject.php:116ReplyDoneAbstractMenuContentObject.php:266ReplyDone -
core-ci voted on patch set 2 V +1 10/04/21, 03:24 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17525
-
crell commented on patch set 2 CR +1 10/04/21, 07:46
One stylistic note. Giving a +1 anyway since it's a non-blocker and the release is imminent.AbstractMenuContentObject.php:273In most other places we've been using ?? false instead of isset(). Both work, but ($levelRec('_MP_PARAM') ?? false) && ($levelRec['_MOUNT_OL'] ?? false) would be more consistent with code elsewhere. (I have no strong preference.) -
Stefan Bürk commented on patch set 2 10/04/21, 07:55
AbstractMenuContentObject.php:273ReplyWas nen oversight by me that original patch changed that. Good point. But should't this be two !empty() checks around ? No need for ?? than there, as empty() works notice free if not set. -
Stefan Bürk commented on patch set 2 10/04/21, 08:00
AbstractMenuContentObject.php:273ReplyMeaning: ``` if (!empty($levelRec['_MP_PARAM']) && !empty($levelRec['_MOUNT_OL'])) { ```AbstractMenuContentObject.php:290Same here ... ``` if (!empty($levelRec['_MP_PARAM']) && empty($levelRec['_MOUNT_OL'])) { ``` -
crell commented on patch set 2 10/04/21, 08:04
AbstractMenuContentObject.php:273ReplyYou're right. In this case, empty() should cover all cases correctly. That's even better. -
Stefan Bürk uploaded patch set 3 10/04/21, 08:06
-
Stefan Bürk commented on patch set 3 10/04/21, 08:07
AbstractMenuContentObject.php:273ReplyDoneAbstractMenuContentObject.php:290ReplyDone -
Robert Kärner commented on patch set 3 10/04/21, 08:17
ContentContentObject.php:117I think we should fall back to the expected type of the $pidConf parameter, which is array. This would help adding strict typing to the getSlidePids() function in the future. -
Stefan Bürk commented on patch set 3 10/04/21, 08:20
ContentContentObject.php:117ReplyMh. getSlidePids() checks for is_array() and !empty. Strict typeing with ?array possible with this. Thought about this too, but as there is the possible for nullable, left as null. -
core-ci voted on patch set 3 V +1 10/04/21, 08:25 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17533
-
Robert Kärner commented on patch set 3 10/04/21, 09:11
ContentContentObject.php:117ReplyIt does? At least in current master, $pidConf just gets checked for isset() and is then passed to stdWrap() which also expects array. The is_array() and !empty() checks are performed on a different array $listArr. The todo comment also talks about introducing strict typing to just array in the future ... -
Nikita Hovratov commented on patch set 3 CR +1 10/04/21, 09:13
ContentContentObject.php:117ReplyBut the check is for $listArr, not $pidConf. Anyway, there is a isset check. Both would work, I guess.
-
Stefan Bürk uploaded patch set 4 10/04/21, 09:17
-
Stefan Bürk commented on patch set 4 10/04/21, 09:19
ContentContentObject.php:117ReplyNot looked correct in the method. Changed as mentioned. Thx for pointing out @Robert Kärner. -
Oliver Klee voted on patch set 4 CR +1 10/04/21, 09:24
-
Nikita Hovratov voted on patch set 4 CR +1 10/04/21, 09:26
-
Robert Kärner voted on patch set 4 CR +1 10/04/21, 09:26
-
Nikita Hovratov voted on patch set 4 V +1 10/04/21, 09:37
-
core-ci voted on patch set 4 V +1 10/04/21, 09:37 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17541
-
Simon Gilli voted on patch set 4 V +1 CR +1 10/04/21, 10:10
-
Stefan Bürk voted on patch set 4 V +1 CR +1 10/04/21, 10:11
-
Oli Bartsch commented on patch set 4 10/04/21, 10:15
AbstractMenuContentObject.php:268Why do we replace the strict type null coalescing operator with the magic empty() function? -
Nikita Hovratov commented on patch set 4 10/04/21, 10:47
AbstractMenuContentObject.php:268ReplyI think there is no real reason. In the end it is even more like it was before the coalesce operator change. (bool) and !empty is the exact same as stated in the php docs: https://www.php.net/manual/de/types.comparisons.php -
Stefan Bürk commented on patch set 4 10/04/21, 10:55
AbstractMenuContentObject.php:268ReplyMatthias changed it to isset() and $var calls, why I'm not sure. For that empt() / !empty() is more equaliant than the original. Why the original change away I could only assume that it needed a check for isset but empty string in some way - should be answered by him. If there was no reason, than the original ones are better than the empty() checks. -
Mathias Bolt Lesniak commented on patch set 4 10/04/21, 12:50
AbstractMenuContentObject.php:268ReplyI originally used isset() because it's what worked to solve the errors. To be honest, I didn't think about null coalesce. I prefer null coalesce over empty() because I find it's more specific. Apart from that, I have no opinion. -
Stefan Bürk commented on patch set 4 10/04/21, 12:57
AbstractMenuContentObject.php:268ReplyOkay .. orginial it was ``` if (($levelRec['_MP_PARAM'] ?? false) && ($levelRec['_MOUNT_OL'] ?? false)) { ``` what you have changed to isset() - and that is what is now confusing. You changed it because of a message/error ? -
Mathias Bolt Lesniak commented on patch set 4 10/04/21, 13:20
AbstractMenuContentObject.php:268ReplyYes, this is confusing. As far as I remember, I originally got an error there after solving the issue on line 262. Maybe it was just a fluke. If the change turns out to be unnecessary, I guess it should just be removed. -
Mathias Bolt Lesniak commented on patch set 4 10/04/21, 14:43
AbstractMenuContentObject.php:268ReplyYou're right. The change on this line is unnecessary and should be reverted. I repeated the steps again, and the error is only on line 278, not 268. -
Stefan Bürk commented on patch set 4 10/04/21, 14:44
AbstractMenuContentObject.php:268Replywill push the revert in a min -
Mathias Bolt Lesniak uploaded patch set 5 10/04/21, 14:47
-
Nikita Hovratov voted on patch set 5 V +1 CR +1 10/04/21, 14:49
-
Mathias Bolt Lesniak commented on patch set 5 10/04/21, 14:49
AbstractMenuContentObject.php:268ReplyToo late. I pushed it already. Sorry. -
Oliver Klee voted on patch set 5 CR +1 10/04/21, 14:57
-
core-ci voted on patch set 5 V +1 10/04/21, 15:09 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17567
-
crell voted on patch set 5 CR +1 10/04/21, 15:37
-
Benni Mack voted on patch set 5 V +2 CR +2 10/04/21, 16:36
-
Benni Mack merged patch set 6 10/04/21, 16:37
ContentContentObject.php:116