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

interfaces: squelch warnings during parse #3035

Closed
fichtner opened this issue Dec 10, 2018 · 5 comments
Closed

interfaces: squelch warnings during parse #3035

fichtner opened this issue Dec 10, 2018 · 5 comments
Assignees
Labels
cleanup Low impact changes
Milestone

Comments

@fichtner
Copy link
Member

[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 359
[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 359
[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 360
[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 360
[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 361
[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 361
[09-Dec-2018 11:44:56 Europe/Athens] PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/etc/inc/interfaces.lib.inc on line 362

via https://forum.opnsense.org/index.php?topic=10614.0

@fichtner fichtner added the cleanup Low impact changes label Dec 10, 2018
@fichtner fichtner added this to the 19.1 milestone Dec 10, 2018
@fichtner fichtner self-assigned this Dec 10, 2018
@AdSchellevis
Copy link
Member

This shouldn't happen, 'option' from the error here
https://github.com/opnsense/core/blob/18.7.8/src/etc/inc/interfaces.lib.inc#L359

Is always initialised here:

$result[$current_interface]["options"] = array();

Maybe a broken patch installed?

@fabianfrz
Copy link
Member

@AdSchellevis except in probably one case: the interface did not exist yet when ifconfig was called…

@AdSchellevis
Copy link
Member

@fabianfrz your right, it's not legacy_interfaces_details(), but legacy_interface_details() that's returning an empty result set.

@AdSchellevis
Copy link
Member

@fichtner 8b73d9e should be the issue here :)

fichtner pushed a commit that referenced this issue Dec 11, 2018
…tails() returns an empty array, closes #3035

(cherry picked from commit 8b73d9e)
@fichtner fichtner assigned AdSchellevis and unassigned fichtner Dec 11, 2018
@fichtner
Copy link
Member Author

fichtner commented Dec 11, 2018

Aha, nice catch. I changed the behaviour slightly in 7fe52b2 to always return an empty array because I thought that would be safer than doing call_this_one()['now_get_this_magic_offset'] that PHP seems to be returning with null silently(*).

(*) until it doesn't in a future PHP upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Low impact changes
Development

No branches or pull requests

3 participants