Fatal Error on ManagePanel #6

Closed
opened 3 years ago by elalann · 3 comments

Hello Skylar,

Not sure if you're still manintaning this, I guess the answer is yes.
Somehow on alternativeto I found your software, BinStack, and it's awesome.

I tested it, I fell in love and tried to do a deploy again this time in a clean VM (not shared with other things) so we can restrict the access to only me and my friends.

Somehow, on this try, I'm getting an error ONLY when I try to add another user. Everything else seems to work great.

CentOS8/httpd 2.4.37 - PHP 7.4 - No FirewallD - No SELinux

Fatal error: Uncaught TypeError: Argument 1 passed to AccountStatus::__construct() must be of the type int, null given, called in /var/www/ControlCuentas/lib/User.lib.php on line 221 and defined in /var/www/ControlCuentas/lib/User.lib.php:285 Stack trace: #0 /var/www/ControlCuentas/lib/User.lib.php(221): AccountStatus->__construct() #1 /var/www/ControlCuentas/pages/edituser.php(47): User->getStatus() #2 /var/www/ControlCuentas/app.php(182): include_once('/var/www/Contro...') #3 {main} thrown in /var/www/ControlCuentas/lib/User.lib.php on line 285

The only difference this time, it's I've renamed the apps, BinStack -> ControlInventario / ManagePanel -> ControlCuentas / AccountHub -> PanelPrincipal

And yes, It's on spanish.

At a first glance I throught it could be something related with one character of my surname (á) but I deleted the databases, uploaded new ones and still no luck.

I'm also running a Nginx Reverse Proxy in front of it.

Regards,

Alan.

Hello Skylar, Not sure if you're still manintaning this, I guess the answer is yes. Somehow on alternativeto I found your software, BinStack, and it's awesome. I tested it, I fell in love and tried to do a deploy again this time in a clean VM (not shared with other things) so we can restrict the access to only me and my friends. Somehow, on this try, I'm getting an error ONLY when I try to add another user. Everything else seems to work great. CentOS8/httpd 2.4.37 - PHP 7.4 - No FirewallD - No SELinux ``` Fatal error: Uncaught TypeError: Argument 1 passed to AccountStatus::__construct() must be of the type int, null given, called in /var/www/ControlCuentas/lib/User.lib.php on line 221 and defined in /var/www/ControlCuentas/lib/User.lib.php:285 Stack trace: #0 /var/www/ControlCuentas/lib/User.lib.php(221): AccountStatus->__construct() #1 /var/www/ControlCuentas/pages/edituser.php(47): User->getStatus() #2 /var/www/ControlCuentas/app.php(182): include_once('/var/www/Contro...') #3 {main} thrown in /var/www/ControlCuentas/lib/User.lib.php on line 285 ``` The only difference this time, it's I've renamed the apps, BinStack -> ControlInventario / ManagePanel -> ControlCuentas / AccountHub -> PanelPrincipal And yes, It's on spanish. At a first glance I throught it could be something related with one character of my surname (á) but I deleted the databases, uploaded new ones and still no luck. I'm also running a Nginx Reverse Proxy in front of it. Regards, Alan.
Poster

Found the problem, and the fix.
When installing, first AccountHub, then ManagePanel, along with various kinds of errors (like missing material-colors css, and some .map files of bootstrap) i saw three lines:

Deprecated: implode() Passing glue string after array is deprecated. Swap the parameters in /var/www/ControlCuentas/vendor/catfan/medoo/src/Medoo.php on line 489

The same line by three, with line numbers 489, 949 and 964.
What I (mistakenly) thought was "If I update the Medoo framework, the error will go away".
Indeed, it went away but somehow due to some kind of change in the versions, it made this error.

The fix was doing exactly what the error said, swapping the ('value1','value2') between them.
So far it seems to be working, but im a little worried because in one of the values (line 949 if I remember correctly) it said something like ' AND ' and as I'm not a programmer at all, I don't know what downsides can come with the swap.

Mr. Google and his friend StackOverflow says this warning was introduced on new versions of PHP, so it makes sense because I'm running the latest PHP 7.4 from the remi-repo.

Regards,

Alan.

Found the problem, and the fix. When installing, first AccountHub, then ManagePanel, along with various kinds of errors (like missing material-colors css, and some .map files of bootstrap) i saw three lines: ``` Deprecated: implode() Passing glue string after array is deprecated. Swap the parameters in /var/www/ControlCuentas/vendor/catfan/medoo/src/Medoo.php on line 489 ``` The same line by three, with line numbers 489, 949 and 964. What I (mistakenly) thought was "If I update the Medoo framework, the error will go away". Indeed, it went away but somehow due to some kind of change in the versions, it made this error. The fix was doing exactly what the error said, swapping the ('value1','value2') between them. So far it seems to be working, but im a little worried because in one of the values (line 949 if I remember correctly) it said something like ' AND ' and as I'm not a programmer at all, I don't know what downsides can come with the swap. Mr. Google and his friend StackOverflow says this warning was introduced on new versions of PHP, so it makes sense because I'm running the latest PHP 7.4 from the remi-repo. Regards, Alan.
elalann closed this issue 3 years ago
Owner

Hi,

I'm glad you got it figured out.

Did you make any code changes to fix it, or was updating Medoo enough?

FYI, the .map files have no purpose in normal use and are only loaded by your web browser if the developer tools are open. The material-colors css can be installed by running git submodule init && git submodule update in the installation folder.

Hi, I'm glad you got it figured out. Did you make any code changes to fix it, or was updating Medoo enough? FYI, the .map files have no purpose in normal use and are only loaded by your web browser if the developer tools are open. The material-colors css can be installed by running `git submodule init && git submodule update` in the installation folder.
Poster

Hi!
I made some code changes, because updating Medoo was the culprit of the fatal errors (It seems that the version change affects the code of the app)

Maybe the "good" approach it would be to update Medoo to the latest version and then review the code errors (like the one on the first message of the issue)
For now what I did it's swapping the values on the implode() functions.

I googled about the .map files, and I saw those were used only for development, but I've got some OCD's and I really hate seeing errors and warnings on the browser console.

About the material-colors, well I went the hard way, cloned the material-colors repo and moved the files manually haha.

I'll be testing the changes on the next few days, and if it everything goes right I'll google how to do a pull request to update the files until you can decide if it worth your time updating Medoo.

Regards,
Alan.

EDIT(2min after): Maybe I wasn't clear enough, with the latest Medoo, it doesn't work. Reverted to the Medoo from the repo and made code changes to circumvent the implode() error introduced on latest version's of php.

Hi! I made some code changes, because updating Medoo was the culprit of the fatal errors (It seems that the version change affects the code of the app) Maybe the "good" approach it would be to update Medoo to the latest version and then review the code errors (like the one on the first message of the issue) For now what I did it's swapping the values on the implode() functions. I googled about the .map files, and I saw those were used only for development, but I've got some OCD's and I really hate seeing errors and warnings on the browser console. About the material-colors, well I went the hard way, cloned the material-colors repo and moved the files manually haha. I'll be testing the changes on the next few days, and if it everything goes right I'll google how to do a pull request to update the files until you can decide if it worth your time updating Medoo. Regards, Alan. EDIT(2min after): Maybe I wasn't clear enough, with the latest Medoo, it doesn't work. Reverted to the Medoo from the repo and made code changes to circumvent the implode() error introduced on latest version's of php.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Business/ManagePanel#6
Loading…
There is no content yet.