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

When a plugin INFO file is malformed or missing elements, plugin_load_info_file() should fill missing elements with defaults #2513

Closed
interduo opened this issue Mar 13, 2019 · 6 comments
Assignees
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@interduo
Copy link
Contributor

Describe the bug
There is an empty plugin list.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'pluginlist'
  2. Click on 'log tab'
2019/03/13 10:13:01 - ERROR PHP NOTICE: Undefined index: requires in file: /var/www/html/cacti/plugins.php on line: 266
--
2019/03/13 10:13:01 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[265]:CactiErrorHandler())
@netniV
Copy link
Member

netniV commented Mar 13, 2019

Check each of the folders immediately beneath the plugins directory, do they have an INFO file in each? Does that file have a requires = line?

@interduo
Copy link
Contributor Author

This situation occurs only 3 times and then disappeared.
I will take another survey about that tommorow to see if it occurs more that today.

@cigamit cigamit added the bug Undesired behaviour label Mar 13, 2019
@netniV netniV added this to the v1.2.3 milestone Mar 13, 2019
@netniV netniV self-assigned this Mar 13, 2019
@netniV netniV changed the title Empty plugin list When a plugin INFO file is malformed or missing elements, plugin_load_info_file() should fill missing elements with defaults Mar 13, 2019
netniV added a commit that referenced this issue Mar 13, 2019
When a plugin INFO file is malformed or missing elements, plugin_load_info_file() should fill missing elements with defaults which are now defined as:

'name'      => directory holding info file
'requires'  => blank
'longname'  => directory holding info file (first letter is uppercased)
'status'    => 0
'version'   => 0.0
'author'    => 'Unknown'
'homepage'  => If webpage is set, use that otherwise 'Not Stated'
'directory' => directory holding info file

This will ensure consistency and that any attempts to use a key such as requires will be present.
@netniV
Copy link
Member

netniV commented Mar 13, 2019

This is now in the main development code, please check and close if issue is resolved.

@netniV netniV added the resolved A fixed issue label Mar 13, 2019
@interduo
Copy link
Contributor Author

It didn't happen more than few times. I did update and It didn't happen again also so I close issue.
Thanks for code cleanup.

@interduo
Copy link
Contributor Author

interduo commented Mar 13, 2019

2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[234]:CactiErrorHandler())
--
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 234
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[192]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 192
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[234]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 234
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[192]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 192
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[234]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 234
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[192]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 192
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[227]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 227
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[192]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 192
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[234]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 234
2019/03/13 14:30:32 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins.php[135]:update_show_current(), /plugins.php[323]:plugins_load_temp_table(), /plugins.php[192]:CactiErrorHandler())
2019/03/13 14:30:32 - ERROR PHP NOTICE: Undefined index: name in file: /var/www/html/cacti/plugins.php on line: 192

The code cleanup caused an error& notices in php

@interduo interduo reopened this Mar 13, 2019
@netniV netniV closed this as completed in 6108e87 Mar 13, 2019
@netniV
Copy link
Member

netniV commented Mar 13, 2019

This has now been committed to the development code.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants