joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[4.4] Fix Sample data installation, fix finder helper addContentType null value

Open Fedik opened this issue 1 year ago • 12 comments

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

Fedik avatar Mar 16 '24 09:03 Fedik

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.

toivo avatar Mar 19 '24 01:03 toivo

I have updated test instruction, old one was more for 5.x.

Fedik avatar Mar 19 '24 08:03 Fedik

Don't got the error in Joomla 4.4.7-dev, Mamp 7, PHP 8.3.8, Mac 14.5: Ohne Titel

ghost avatar Aug 06 '24 09:08 ghost

Error reaporting should be set to Maximum. To be able to see messages about deprections.

Fedik avatar Aug 06 '24 10:08 Fedik

Error reporting was set to Maximum.

ghost avatar Aug 06 '24 10:08 ghost

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));

Fedik avatar Aug 06 '24 10:08 Fedik

I cannot create the error either.

image

image

image

All that happens is that an int is displayed which increases on each page load image

brianteeman avatar Aug 06 '24 10:08 brianteeman

I have no idea then. I can clearly see it on my PHP 8.1

Fedik avatar Aug 06 '24 10:08 Fedik

Ah, wait. I found, please use MySQL PDO, not MySQLi. I have update the issue description.

Fedik avatar Aug 06 '24 10:08 Fedik

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.

TLWebdesign avatar Aug 24 '24 13:08 TLWebdesign

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.

mabdelaziz77 avatar Aug 24 '24 14:08 mabdelaziz77

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43052.

Quy avatar Aug 24 '24 14:08 Quy

Thanks!

laoneo avatar Aug 30 '24 05:08 laoneo