Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Elvis operator in GeneratesDocumentationSidebar.php skips first entry in sidebar order array #232

Closed
caendesilva opened this issue May 2, 2022 · 0 comments · Fixed by #234

Comments

@caendesilva
Copy link
Member

Line 33 in GeneratesDocumentationSidebar.php

$order = array_search($slug, $orderArray) ?: 999;

thinks that the first array key which is 0 is false and assigns it 999.

Fixed using

$order = ($position = array_search($slug, $orderArray)) === null ? 999 : $position;
caendesilva added a commit that referenced this issue May 2, 2022
caendesilva pushed a commit that referenced this issue Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant