This PR simply remove unnecessary condition check in elseif command. That check always return true (if it return false, the code in if block will be run), so it is not needed.
Testing
This can be seen easily from code review. So I think we just need to a maintainer to review and merge it.
I will do the the same modification for other components (has this same unnecessary code) if this PR is approved.
Merged into staging, however without your last commit which is a complete unrelated change.
Please do a new PR with that fix as that one needs to be tested. Currently, the id always will be 0 (since $menu isn't defined). After your change it will have a value which may change the following checks.
Also the suppressed error (@$menu->query['id']) should be removed. If $menu isn't defined, we have a problem in the code we actually want to see
Hmm, I didn't include the commit which you reverted with "Sorry, I updated wrong file before".
Feel free to create a new PR for that, I can merge it on review as well.
RTC based on review. Needs to be squashed before merging.