When importing packages, hash types are not properly processed#4695
When importing packages, hash types are not properly processed#4695netniV merged 2 commits intoCacti:1.2.xfrom
Conversation
ddb4github
commented
Apr 11, 2022
- $ignorable_type_code_hashes is not initialized before used
- Incorrect arg position of array_search
|
This fix does not fix the package corruption. Should get it fixed later today. |
The packages included in this commit should fix all the issues encountered from the release. It also reverted #4695 that reserved the order of array_search() by accident.
This PR only fix var_dump($dep_hash);
var_dump($dep_status);
var_dump($ignorable_type_code_hashes);
if ($dep_status == 'met') {
$dep_status_text = "<span class='foundDependency'>" . __('Found Dependency:') . '</span>';
} else if (array_search($ignorable_type_code_hashes, $dep_hash) === false) {
$dep_status_text = "<span class='unmetDependency'>" . __('Unmet Dependency:') . '</span>';
$dep_errors = true;
} |
|
The array_search($needle, $haystack); |
|
@TheWitness is correct @ddb4github. The function should have the needle first: https://www.php.net/manual/en/function.array-search.php |
|
However, I have just re-committed the correct array_search call as it was wrong in the code still. There is also the removal of a check that the ignorable's variable exists. That check created an empty array which may not be desirable either so I've flagged that on the commit and @TheWitness and I will likely have to discuss how that could happen if at all. |
Yes, #4695 (comment) just show previous code line before you re-commit. BTW, as your said (#4695 (comment)), |