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

Adding new smile upload error message #1144

Closed
jorgenqv opened this issue Jan 9, 2022 · 4 comments
Closed

Adding new smile upload error message #1144

jorgenqv opened this issue Jan 9, 2022 · 4 comments

Comments

@jorgenqv
Copy link

jorgenqv commented Jan 9, 2022

XOOPS Version: 2.5.11 Beta2 current master downloaded from Github (Dec-31-2021)
PHP Version:  8.0.14
mySQL Version:  5.5.5-10.3.32-MariaDB-1:10.3.32+maria~focal
Server API: 	cgi-fcgi
OS:  Linux (Host one.com)

Issue
Getting Xoops error page when adding smilie in Admin Control Panel Home, Similes. However, the smilie is added and file is uploaded.

Steps to reproduce

  1. Go to Control Panel Home and click Similes
  2. Click right side button Add a new simile
  3. Fill out code and description and choose a simile in Upload
  4. Click on Submit

Expected behaviour
A confirmation message that the smilie is added.

Other information
Debug error information bellow (Link Please come back soon... is to “/” and not site Home Page).

A problem has occurred on our server!
Page is currently unavailable

We are working on a fix
Please come back soon …

Error : TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given
Backtrace:
None All Errors (2) Deprecated (0) Queries (22) Blocks (0) Extra (3) Timers(5)
Errors
Warning: Undefined variable $err in file /modules/system/admin/smilies/main.php line 175
Error: TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in file /modules/system/admin/smilies/main.php line 175
Deprecated
Queries
0.000200 - SET SQL_BIG_SELECTS = 1
0.001757 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.000524 - SELECT sess_data, sess_ip FROM session WHERE sess_id = '8fcf831d8d765b1b70f1e63205b205f3'
0.000546 - SELECT * FROM users WHERE uid = '1'
0.000515 - SELECT * FROM modules WHERE dirname = 'system'
0.002059 - SELECT * FROM config WHERE (conf_modid = '1') ORDER BY conf_order ASC
0.000741 - DELETE FROM protector_access WHERE expire < UNIX_TIMESTAMP()
0.000397 - SELECT COUNT() FROM protector_access WHERE ip='78.82.202.13' AND request_uri='/jorgen/xoops/modules/system/admin.php?fct=smilies&op=new_smilie'
0.000284 - SELECT COUNT(
) FROM protector_access WHERE ip='78.82.202.13'
0.000341 - INSERT INTO protector_access SET ip='78.82.202.13', request_uri='/jorgen/xoops/modules/system/admin.php?fct=smilies&op=new_smilie', expire=UNIX_TIMESTAMP()+'60'
0.000593 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '5') ORDER BY conf_order ASC
0.000545 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC
0.000492 - SELECT * FROM modules WHERE (hasadmin = '1' AND isactive = '1') ORDER BY weight ASC, mid ASC
0.000507 - SELECT * FROM modules WHERE dirname = 'protector'
0.000271 - SELECT * FROM modules WHERE mid = 4
0.000289 - SELECT * FROM modules WHERE dirname = 'news'
0.001444 - SELECT * FROM config WHERE (conf_modid = '5') ORDER BY conf_order ASC
0.000485 - SELECT * FROM modules WHERE dirname = 'profile'
0.000351 - SELECT * FROM modules WHERE dirname = 'pm'
0.000389 - SELECT * FROM modules WHERE dirname = 'contact'
0.000639 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '4') ORDER BY conf_order ASC
0.000392 - INSERT INTO smiles (code, smile_url, emotion, display) VALUES (':test2:','smilies/smil61da195a251f0.gif','test',0)
Total: 22
Blocks
Total: 0
Extra
Token Validation: Valid token found
Included files: 196 files
Memory usage: 1283704 bytes
Timers
XOOPS took 0.046 seconds to load.
XOOPS Boot took 0.015 seconds to load.
Module init took 0.005 seconds to load.
XOOPS output init took 0.002 seconds to load.
Module display took 0.024 seconds to load.

@mambax7
Copy link
Collaborator

mambax7 commented Jan 9, 2022

@jorgenqv
Thank you for the test and for reporting of the issue. Obviously, we still don't support fully PHP 8, but a quick fix for your issues is to add around line 144 in the main.php file this:

 $err = [];

and this will fix it. At least it work over here...

@jorgenqv
Copy link
Author

Thank you for your quick fix suggestion, but the only main.php file I find in the module is the one in language/english or do you mean another file? Tried adding to modfile.php and updated but no difference on my web host?

@mambax7
Copy link
Collaborator

mambax7 commented Jan 10, 2022

That's the file where the error was reported above:
image

@jorgenqv
Copy link
Author

Aha yes, I mixed up things, sorry about the confusion ;)
Can confirm that it works on my install!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants