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

Problem with Knowledge Management Module #31641

Open
ITperfC opened this issue Oct 30, 2024 · 0 comments
Open

Problem with Knowledge Management Module #31641

ITperfC opened this issue Oct 30, 2024 · 0 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@ITperfC
Copy link

ITperfC commented Oct 30, 2024

Bug

2 bugs with the same module :
1/ Tables knowledge management has not been created during deployment process, we had to create them manually with their foreign key, we got SQL script from install folder
2/ During configuration, we can't change numbering, we got an error identified as hacking tentative

Dolibarr Version

20.0.1

Environment PHP

8.2

Environment Database

No response

Steps to reproduce the behavior and expected behavior

After restoring the 3 tables used by this module with their foreign key, the interface for configuring the module worked fine.
If you try to configure the module by changing the state of the numbering model from 'standard' to 'advanced' you got the error, however you already filled the mask or not.
We were able to identify the root cause on the code and resolve it, on the file '/admin/knowledgemanagement.php', you'll find the portion of code below with our explanation.

Attached files

Screenshot of the error :
image

Following the PHP code we changed from line 75 to 79 into the file '/admin/knowledgemanagement.php', the changes we made is just to bypass the problem :

$tmpobjectkey = GETPOST('object', 'aZ09');
if($tmpobjectkey='knowledgerecord') $tmpobjectkey='KnowledgeRecord'; // -- New line added --
if ($tmpobjectkey && !in_array($tmpobjectkey, $myTmpObjects['knowledgemanagement'])) { // if ($tmpobjectkey && !array_key_exists($tmpobjectkey, $myTmpObjects)) { -- Original Value --
accessforbidden('Bad value for object. Hack attempt ?');
}

Following our opinion about the error :
1/ The variable '$tmpobjectkey' is filled with the right value but there's problem with case letter, to avoid major changing we included an if condition to change the value to right case
2/ The condition will never work as it is looking on the wrong place, we made the right change to make it working

Hope this help
Good luck ;-)

@ITperfC ITperfC added the Bug This is a bug (something does not work as expected) label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

1 participant