By CanadianJevents54 on Monday, 06 March 2023
Replies 7
Likes 0
Views 608
Votes 0
Hi,
When you try to configure Jevents with PHP 8.0 and Joomla 3.10.11 and Jevents 3.6.48
You obtain an error of compatibility with PHP 8
Sorry, i don't note this error. But you can easily repeat this one PHP 8.0 and Joomla 3.10.11 and Jevents 3.6.48, and trying to click on "Configure Jevents" Button (to the top right)
With PHP 7.4 this error disappear.
Here is the error message :
"htmlspecialchars(): Argument #1 ($string) must be of type string, array given"
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Can you enable Joomla debug mode and try again - it would give the line number of file where the error arises
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Geraint,
Thank you for taking care of this problem.
Sorry for not having done it before. But it is a site in production (several GB of data)
I will install a test version to give you the debug mode info.
Do you think it could come from an extension of Jevents?
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
It seems to be the field plugin (i will renew my account as soon as possible)

Here is the message with debug mode :
htmlspecialchars(): Argument #1 ($string) must be of type string, array given
/home/nfrqepxx/.../2023test/layouts/joomla/form/field/text.php:82

And here the code of the file

78 <input type="text" name="<?php
79 echo $name; ?>" id="<?php
80 echo $id; ?>" <?php
81 echo $dirname; ?> value="<?php
82 echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" <?php echo implode(' ', $attributes); ?> />
83 <?php if ($options) : ?>
84 <datalist id="<?php echo $id; ?>_datalist">
85 <?php foreach ($options as $option) : ?>
86 <?php if (!$option->value) : ?>
87 <?php continue; ?>
88 <?php endif; ?>
89 <option value="<?php echo $option->value; ?>"><?php echo $option->text; ?></option>
90 <?php endforeach; ?>
91 </datalist>
92 <?php endif; ?>
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
I changed the code to fixe this problem, like that :
I copied some code before and after my changes .... So it will be more easy for other users to apply my fix...


<input type="text" name="<?php
echo $name; ?>" id="<?php
echo $id; ?>" <?php
echo $dirname; ?> value="
<?php
if (is_array($value))
{
$expanded = print_r($value, true);
echo $key . ' *** ' . $expanded;
}
else
{
echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
}
?>
" <?php echo implode(' ', $attributes); ?> />
<?php if ($options) : ?>
<datalist id="<?php echo $id; ?>_datalist">
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
If you use $name instead of $key in that code it would allow you to isolate which field is causing the problem
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for your advice.
My fix avoid this problem.
Go beyond in order to find the field guilty become to complicated for me.
I will migrate my site on J4 And i will see if this problem occurs with J4.
I will keep you informed and possibly I will ask you for help when I have renewed my registration.
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post