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

Plugin setup can generate errors when reading options via system function #3793

Closed
kim-fitness opened this issue Sep 7, 2020 · 0 comments
Closed
Labels
bug Undesired behaviour resolved A fixed issue

Comments

@kim-fitness
Copy link
Contributor

Describe the bug

  1. Register hook function as below
    api_plugin_register_hook('disku', 'config_arrays', 'disku_config_arrays', 'setup.php');
  2. Define the hook function as below
function disku_config_arrays() {
...
	$disku_rows_selector = array(
		-1   => __('Default:'.((null!=read_config_option('num_rows_table'))?read_config_option('num_rows_table'):'30'), 'disku'),
                ...
	);
  1. Then the error occurs as calling undefined variable '$settings' from function read_default_config_option in cacti/lib/functions.php
@kim-fitness kim-fitness added bug Undesired behaviour unverified Some days we don't have a clue labels Sep 7, 2020
TheWitness added a commit that referenced this issue Sep 12, 2020
* Fix issue #3793

* Update CHANGELOG

* Minor updates.

Co-authored-by: TheWitness <thewitness@cacti.net>
@TheWitness TheWitness added resolved A fixed issue and removed unverified Some days we don't have a clue labels Sep 12, 2020
TheWitness pushed a commit that referenced this issue Sep 15, 2020
* Update CHANGELOG

* Update functions.php
@netniV netniV changed the title Calling function read_config_option in plugin's setup.php leads to error Plugin setup can generate errors when reading options via system function Nov 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2021
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

2 participants