joomla-cms
joomla-cms copied to clipboard
[4.4] Fix Sample data installation, fix finder helper addContentType null value
Pull Request for Issue # .
Summary of Changes
Helper::addContentType() allows null for mime, however $db->quote() does not. Same as https://github.com/joomla/joomla-cms/pull/43051 but for 4.4
Testing Instructions
Use PHP 8+, set error reaporting to Maximum. Set DB driver to use MySQL PDO ~~On clean installation, try install "Blog Sample Data"~~
Run following code (example in index.php of the template):
$name = uniqid(); // Imitating a new content type name, can be any string
var_dump(Joomla\Component\Finder\Administrator\Indexer\Helper::addContentType($name));
Actual result BEFORE applying this Pull Request
PHP warning Deprecated: PDO::quote(): Passing null to parameter 1 ($string) of type string is deprecated
Expected result AFTER applying this Pull Request
No warning
Link to documentations
Please select:
- [ ] Documentation link for docs.joomla.org:
- [x] No documentation changes for docs.joomla.org needed
- [ ] Pull Request link for manual.joomla.org:
- [x] No documentation changes for manual.joomla.org needed
I have tested this item :red_circle: unsuccessfully on 1738f32b84c688e0b3180ccc71e9f357bfc3cdf9
Unable to reproduce the error in out-of-the-box Joomla 4.4.4-dev, run in Wampserver 3.3.3 usin PHP 8.2.13 on Windows 11.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43052.
I have updated test instruction, old one was more for 5.x.
Don't got the error in Joomla 4.4.7-dev, Mamp 7, PHP 8.3.8, Mac 14.5:
Error reaporting should be set to Maximum. To be able to see messages about deprections.
Error reporting was set to Maximum.
Something is hidding the PHP message then. Can also try like:
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$name = uniqid(); // Imitating a new content type name, can be any string
var_dump(Joomla\Component\Finder\Administrator\Indexer\Helper::addContentType($name));
I cannot create the error either.
All that happens is that an int is displayed which increases on each page load
I have no idea then. I can clearly see it on my PHP 8.1
Ah, wait. I found, please use MySQL PDO, not MySQLi. I have update the issue description.
I have tested this item :white_check_mark: successfully on 1738f32b84c688e0b3180ccc71e9f357bfc3cdf9
Tested successfully on J4.4.7
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43052.
I have tested this item :white_check_mark: successfully on 1738f32b84c688e0b3180ccc71e9f357bfc3cdf9
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43052.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43052.
Thanks!