User tests: Successful: Unsuccessful:
Pull Request for Issue #40680 .
This pull request (PR) fixes the PHP warnings reported in the linked issue when installing Blog Sample Data by adding an isset
check.
In addition it fixes PHP Warning: Undefined array key "searchindex" in /administrator/components/com_fields/src/Model/FieldModel.php on line 886
happening when publishing or unpublishing a field which doesn't have the "searchindex" parameter set, e.g. when having updated from 4.4 and not saved the field again, or when having installed Blog Sample Data without that parameter.
This is one possible way to fix the issue, but it might be not the best way.
@Hackwar Please check. I have tested and it works, but as said, it might be the wrong way to fix it. But keep in mind that when updating from 4.4 and not having a migration for the fields parameters, we always might run into the new parameter not being set.
On a clean, current 5.0-dev branch where PR #38650 has been merged, make a new installation.
Then login to backend.
Then either set error reporting to maximum or make sure that PHP warnings are logged into a log file.
PHP warnings:
PHP Warning: Undefined array key "searchindex" in /administrator/components/com_fields/src/Model/FieldModel.php on line 119
PHP Warning: Attempt to read property "params" on null in /administrator/components/com_fields/src/Model/FieldModel.php on line 120
PHP Warning: Trying to access array offset on value of type null in /administrator/components/com_fields/src/Model/FieldModel.php on line 120
PHP Warning: Undefined array key "searchindex" in/administrator/components/com_fields/src/Model/FieldModel.php on line 120
PHP Warning: Undefined array key "searchindex" in /administrator/components/com_fields/src/Model/FieldModel.php on line 121
When error reporting is set to maximum, the Blog Sampe Data installation fails.
No PHP warnings, installation of Blog Sample Data succeeds in any case.
Please select:
No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed
Category | ⇒ | Administration com_fields |
Status | New | ⇒ | Pending |
Labels |
Added:
PR-5.0-dev
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-05-29 17:31:09 |
Closed_By | ⇒ | HLeithner |
thanks