This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 240
fix(clapi): require the root bootstrap.php breaks some class loading #11476
Closed
proxyconcept
wants to merge
18
commits into
centreon:dev-22.04.x
from
proxyconcept:fix-clapi-class-not-found
Closed
fix(clapi): require the root bootstrap.php breaks some class loading #11476
proxyconcept
wants to merge
18
commits into
centreon:dev-22.04.x
from
proxyconcept:fix-clapi-class-not-found
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…centreon#11394) * Sanitize and bind ACL host dependency queries * fix issues
…entreon#11352) Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com>
* update user menu
lines : 130 -142
* sanitizing and binding sync dir file queries * Applying some fixes
…tion (centreon#11440) * fix(UI): Fix layout for Safari and form validation (centreon#11373) * Fix form validation * Fix padlock layout for safari * Update centreon-frontend * Remove debug variable * Fix test * Fix page respsoniveness * Rename variable * update deps * Fix package-lock * Fix package-lock * Add debug statement for debian * Install nodejs rather npm * Attempt fix * Attempt to fix nodejs installation * add sudo * Fix redoc-cli usage * Try to fix permission on npm * Fix * Fix permission * Fix permission (please work) * Fix source * Stop using npx because..... * Allow legacy-peer-deps * Remove nodejs installation * Fix image to pull for debian 11
…entreon#11402) * Sanitize and bind ACL action access queries _ sanitize if possible each variables inserted in a query _ use PDO prepared statement and bind() method _ Do not use $pearDB->escape on which is for examples useless on integers and on non closed HTML tags (svg, img, etc) * fix line length * fix failed checks
* Clean(platform): Clean appKey method and usage (centreon#11336) * removing appKey from information table in baseConf and 22.10 update script * removing appKey from NotifyMasterService.php * removing appKey from CentreonRemoteServer.php * applying suggested changes * Applying suggested changes Co-authored-by: Kevin Duret <kduret@centreon.com> * adding 22.04.2 update script file with changes * revert 22.04 beta 1 script to its original Co-authored-by: Kevin Duret <kduret@centreon.com>
…tion form 22.04.x (centreon#11461) * changing select with select2 of metrics * fix alignement * remove unecessary files and replace selec by select2 in formComponentTemplate * fix select id name for acceptance tests * update composer for acceptance tests * fix acceptance test 2 * add allow clear to metrics select2 * applying suggested changes * final changes for merging * remove unecessary select tag
…#11472) * Sanitize and bind ACL class queries Queries sanitized and bound using PDO statement * fix spaces spaces between (int) cast and variables * update file delete spaces after comma * change variables names due to a review * Line exceeds 120 characters; contains 123 characters
…entreon#11434) Class centreonContact is the only to require 'bootstrap.php' but then other import can failed with class not found exception. But if the root 'bootstrap.php' is not loaded, we must at least redefine the function loadDependencyInjector(). Refs: centreon#11434 Signed-off-by: Grégory Marigot <gmarigot@teicee.com>
proxyconcept
requested review from
a team,
TamazC and
wtermellil
and removed request for
a team
August 1, 2022 08:31
proxyconcept
requested review from
a team,
bdauria and
Jordan91
and removed request for
a team
August 4, 2022 09:14
SonarQube Quality Gate 0 Bugs No Coverage information |
thanks for your contribution @proxyconcept |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…(#11434)
Class centreonContact is the only to require 'bootstrap.php' but then other import can failed with class not found exception.
But if the root 'bootstrap.php' is not loaded, we must at least redefine the function loadDependencyInjector().
Refs: #11434
Signed-off-by: Grégory Marigot gmarigot@teicee.com
Description
Importing with CLAPI can failed with a "class not found" exception.
It seems to failed with lines that can be imported successfully when they are alone. The responsability could be a precedent import line with CONTACT or CONTACTTPL object. So I suspect the class centreonContact to break class loading for some next objects.
By studying the code in centreonContact.class.php i found curious the require_once DIR . '/../../../bootstrap.php'; because it was the only class in centreon-clapi to do it...
Removing this require solves the problems, but some other cases fail because they need the function loadDependencyInjector (defined in the bootstrap.php). So this function definition is also added in centreonAPI.php.
Fixes #11434
Type of change
Target serie
How this pull request can be tested ?
This is a sample file to import:
Which failed without this PR:
I have tested a full export/import successfully with this patch.
Checklist
Community contributors & Centreon team