RTC PHP 8.x bug PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
16 Mar 2024

Pull Request for Issue # .

Summary of Changes

Helper::addContentType() allows null for mime, however $db->quote() does not.
Same as #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:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 16 Mar 2024
avatar Fedik Fedik - change - 16 Mar 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Mar 2024
Category Administration com_finder
avatar Fedik Fedik - change - 16 Mar 2024
The description was changed
avatar Fedik Fedik - edited - 16 Mar 2024
avatar Fedik Fedik - change - 16 Mar 2024
The description was changed
avatar Fedik Fedik - edited - 16 Mar 2024
avatar toivo toivo - test_item - 19 Mar 2024 - Tested unsuccessfully
avatar toivo
toivo - comment - 19 Mar 2024

I have tested this item ? unsuccessfully on 1738f32

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.

avatar Fedik Fedik - change - 19 Mar 2024
The description was changed
avatar Fedik Fedik - edited - 19 Mar 2024
avatar Fedik
Fedik - comment - 19 Mar 2024

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

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
Fix Sample data installation, fix finder helper addContentType null value
[4.4] Fix Sample data installation, fix finder helper addContentType null value
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar fgsw
fgsw - comment - 6 Aug 2024

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

avatar Fedik
Fedik - comment - 6 Aug 2024

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

avatar fgsw
fgsw - comment - 6 Aug 2024

Error reporting was set to Maximum.

avatar Fedik
Fedik - comment - 6 Aug 2024

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));
avatar brianteeman
brianteeman - comment - 6 Aug 2024

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

avatar Fedik
Fedik - comment - 6 Aug 2024

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

avatar Fedik
Fedik - comment - 6 Aug 2024

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

avatar Fedik Fedik - change - 6 Aug 2024
The description was changed
avatar Fedik Fedik - edited - 6 Aug 2024
avatar TLWebdesign TLWebdesign - test_item - 24 Aug 2024 - Not tested
avatar TLWebdesign TLWebdesign - test_item - 24 Aug 2024 - Tested successfully
avatar TLWebdesign
TLWebdesign - comment - 24 Aug 2024

I have tested this item ✅ successfully on 1738f32

Tested successfully on J4.4.7


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

avatar mabdelaziz77 mabdelaziz77 - test_item - 24 Aug 2024 - Tested successfully
avatar mabdelaziz77
mabdelaziz77 - comment - 24 Aug 2024

I have tested this item ✅ successfully on 1738f32


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

avatar Quy Quy - change - 24 Aug 2024
Status Pending Ready to Commit
Labels Added: bug PHP 8.x PR-4.4-dev
avatar Quy
Quy - comment - 24 Aug 2024

RTC


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

avatar laoneo laoneo - change - 30 Aug 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-08-30 05:36:15
Closed_By laoneo
Labels Added: RTC
avatar laoneo laoneo - close - 30 Aug 2024
avatar laoneo laoneo - merge - 30 Aug 2024
avatar laoneo
laoneo - comment - 30 Aug 2024

Thanks!

Add a Comment

Login with GitHub to post a comment