Well, first of all, I have to clarify that the code I was working on was not mine, I was just hired to make some improvements and I had to talk to the main developer to explain this chaos.
What I missed is that each request (each of which was associated with a page refresh) went through an additional file called do.php , which eventually loaded the module I was in again.
Visual Explication:
Currently at Action Pre-Processor Processor ------------- => --------------- => ------------- => --------- add_users.php post from form do.php add_user.php
Now, just now you know, the current location of the module ( http://site.com/module?=add_users ) is saved in the session, and do.php has several lines of code to check this session and turn the module back on, if everything is ok . I know this is a huge mess, but there is nothing I can do about it.
So in the end I had to go to do.php and add the following line around the beginning of the file: require_once('libs/commons.php');
My recommendation
Whenever you see that a function does not load, but you know that it loads fine in certain cases, look for any other file that might interfere with do.php above and try to include / require a file containing the function.
I know that such things can give headaches, but this is what it is, and most of the time it is not our fault, but how the platform was already written.
Good luck everyone
source share