Create dummy module or plugin with your custom field type like
<field type="blablabla" name="blablabla"/>
Specify addfieldpath
attribute for this field in XML manifest
<field type="blablabla" name="blablabla" addfieldpath="modules/mod_blablabla/fields" />
You shoudn't create a field type file modules/mod_blablabla/fields/blablabla.php
Go to admin panel and try to edit your module.
If Joomla Form didn't found a field type php file it shows us a field type text
instead. We expect the same result on all PHP versions.
With PHP 8.0-8.1 we have an error htmlspecialchars(): Argument #1 ($string) must be of type string, array given
Joomla 4.2.7
PHP 8.x+
With PHP 7.4 all is fine
Labels |
Added:
No Code Attached Yet
|
Can not replicate the issue on Joomla 4.3.0-beta2-dev with a custom old-fashioned module. PR closed.
That could happens if there are data stored for that field before and then the class which defines that field type is lost for some reasons (the file is deleted or moved to new location for example...).
Having fatal error like this is not right but we should not hide the error either. To me, the right option would be throw an UnexpectedValueException
but for now, we could leave it as how it is to void people complains when something suddenly broken in a minor or patch release.
Look: I have a module with subform. In this subform I have a fields with addfieldpath, but this path is not really exists (a component for this field type is not installed). When I save module - I have an error. With php 7.4 I haven't errors, with php 8.x I got error.
Sorry for low video quality - 10 mb limit for filesize.
https://user-images.githubusercontent.com/6236403/218484632-66ae0cad-f12e-4e0c-bc67-2a701f9df7b4.mp4
That confirms that it not Joomla issue, you have to ask the extension developer for fix, or install missed component.
With php 7.4 I haven't errors, with php 8.x I got error.
On 7.4 PHP shows warning, and on 8.x throws fatal error for incorect value for htmlspecialchars()
and it should be closed as such
here a major release from php 7 to 8 occurs
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-02-14 07:26:48 |
Closed_By | ⇒ | alikon |
Please test pr #39856