Hi,
testing to update my smart search plugins, I get following error:
A "finder" plugin has had an error
When running in debug mode:
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/vendor/joomla/registry/src/Format/Json.php on line 80
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/vendor/joomla/registry/src/Format/Json.php on line 80
Changing core file: libraries/vendor/joomla/registry/src/Format/Json.php
FROM:
$data = \trim($data);
TO:
$data = \trim((string)$data);
solves the problem.
But of course, I cannot change the core file with the plugin, so the question is, what can be wrong in the plugin which can cause adding null to json function?
Thank you, Jan
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-09-18 22:03:23 |
Closed_By | ⇒ | PhocaCz |
Hmm strange the file you posted doesn't have 80 lines: https://github.com/joomla-framework/registry/blob/3.x-dev/src/Format/Json.php
Hi, yes, sorry for confusion, in this file I had added a few lines for debug (trace where the variable comes from), the message without debug is the line 56 55:
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/vendor/joomla/registry/src/Format/Json.php on line 56 55
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in libraries/vendor/joomla/registry/src/Format/Json.php on line 56 55
It's hard to say, maybe it would be worth to treat the $data (string) somehow, because then it will help to remove the index malfunction for some older plugins.
EDIT:
Actually, the line should be 55 (seems like some empty row is still added on my test environment), the problematic line is:
OK, I found it, it is caused by Joomla\Registry class sending empty values.