No Code Attached Yet Information Required PHP 8.x
avatar counterpoint
counterpoint
20 Feb 2024

Steps to reproduce the issue

Create a Joomla 5.0.2 site. Go to admin interface. Select component Banners. Exact result may vary. On Debian 12 with PHP 8.2 the site crashes and records an error "AH01067: Failed to read FastCGI header".

Expected result

Displays banners information

Actual result

Site crashes

System information (as much as possible)

Debian 12 PHP-FPM 8.2 Joomla 5.0.2

Additional comments

This can also affect third party software that calls the relevant method.

Line 42 sets $date:
$date = Factory::getDate();
This is then used in a bind to a SQL statement. But it is an object. It works if changed to:
$date = (string) Factory::getDate();

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar counterpoint counterpoint - open - 20 Feb 2024
avatar counterpoint counterpoint - change - 20 Feb 2024
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 20 Feb 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Feb 2024
avatar webchun
webchun - comment - 22 Feb 2024

I experience the same issue. When I publish a banner module or even access this page : administrator/index.php?option=com_banners&view=banners with Joomla installed on PHP 8.2.4, it crashes the website. Not only with Joomla 5, but I also experience the issue with Joomla 4.4.0.


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

avatar counterpoint
counterpoint - comment - 22 Feb 2024

Sorry, forgot to mention that the file referred to that contains the error is .../administrator/components/com_banners/src/Helper/BannersHelper.php


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

avatar alikon alikon - change - 22 Feb 2024
Labels Added: PHP 8.x
avatar alikon alikon - labeled - 22 Feb 2024
avatar alikon
alikon - comment - 22 Feb 2024

unable to replicate with php 8.2.16

avatar Quy
Quy - comment - 22 Feb 2024

I cannot reproduce either. Please enable debug mode and set error reporting to maximum to get a stack trace.

avatar alikon alikon - change - 22 Feb 2024
Labels Added: Information Required
avatar alikon alikon - labeled - 22 Feb 2024
avatar alikon
alikon - comment - 22 Feb 2024
avatar webchun
webchun - comment - 22 Feb 2024

I have set the error reporting to maximum and enabled the debug mode, but no stack trace shows up. The issue disappeared when I commented out this line in mod_banners.php: BannersComponentHelper::updateReset();


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42841.
avatar counterpoint
counterpoint - comment - 23 Feb 2024

The results of (string) and ->toSql() are exactly the same (so either works):

var_dump(get_class($date), (string) $date, $date->toSql());

string(20) "Joomla\CMS\Date\Date" string(19) "2024-02-23 11:32:48" string(19) "2024-02-23 11:32:48"

On 23/02/2024 01:49, Tuan Pham Ngoc wrote:

I cannot reproduce the issue, too. However, I can see that the code is wrong. @webchun https://github.com/webchun @counterpoint https://github.com/counterpoint Could you please modify this line of code https://github.com/joomla/joomla-cms/blob/4.4-dev/administrator/components/com_banners/src/Helper/BannersHelper.php#L42 to:

$date =Factory::getDate()->toSql();

Then check it again to see if the error is gon?


Reply to this email directly, view it on GitHub #42841 (comment), or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJG5RKXQT6OILSDGMKT6A3YU7YQ5AVCNFSM6AAAAABDRHM4LOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGYZDOMJXG4.
You are receiving this because you were mentioned.Message ID: @.***>

-- Black Sheep Research icon

 MartinBrampton

Director

Black Sheep Research

Phone icon

+44 1653 487048 <tel:+44 1653 487048> | +44 7771 787010 <tel:+44 7771 787010>

Email icon

***@***.*** ***@***.***>

Website link icon

https://black-sheep-research.com <https://black-sheep-research.com>

Address icon

4 York Road, Malton, YO17 6AX, UK
avatar counterpoint
counterpoint - comment - 23 Feb 2024

Debug and error reporting maximum were already enabled. But since the problem causes PHP to crash, diagnostics of that kind are not feasible. That made the problem difficult to track, since the only initial information was that there was a problem somewhere - probably in PHP code. PHP crashes may well be specific to a precise environnment. But Debian 12 is pretty mainstream. This link provides similar information to the link provided by @alikon but is not specific to Wordpress and indicates that a PHP error is the most common of the possible causes - https://bobcares.com/blog/apache-error-failed-to-read-fastcgi-header/


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

avatar joomdonation
joomdonation - comment - 23 Feb 2024

@counterpoint You are right. I just checked the code more and see that (string) $date and $date->toSql() result in same value. However, I would use $date->toSql() to make it consistent with other places in Joomla. For example https://github.com/joomla/joomla-cms/blob/4.4-dev/components/com_content/src/Model/ArticleModel.php#L184 and https://github.com/joomla/joomla-cms/blob/4.4-dev/components/com_content/src/Model/ArticleModel.php#L202 (Who knows if we use a DB driver using a date format different with Y-m-d H:i:s)

Do you want to make PR with the suggested change?

avatar counterpoint
counterpoint - comment - 23 Feb 2024

That makes sense @joomdonation, although (string) is a lot more efficient. What is PR?


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

avatar joomdonation
joomdonation - comment - 23 Feb 2024

@counterpoint In short, you make code change to to fix the issue. Please try to follow instructions here https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests to make the PR

The file you need to make change is https://github.com/joomla/joomla-cms/blob/4.4-dev/administrator/components/com_banners/src/Helper/BannersHelper.php (for 4.4-dev branch and later it will be up-merge to 5.1)

avatar counterpoint
counterpoint - comment - 23 Feb 2024

Thanks @joomdonation. Sorry, but I'm not familiar with making git pull requests and do not have time to find out. I've precisely identified the fault, that should be enough.


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

avatar joomdonation
joomdonation - comment - 23 Feb 2024

No worry @counterpoint . For the time being, you can make the propose change to your site to have the issue fixed. I will make the pull request on tomorrow to fix this issue so that it won't happen again when you update to future releases of Joomla

avatar counterpoint
counterpoint - comment - 23 Feb 2024

Thanks @joomdonation that's great.


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

avatar joomdonation joomdonation - change - 24 Feb 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-02-24 07:38:14
Closed_By joomdonation
avatar joomdonation joomdonation - close - 24 Feb 2024
avatar joomdonation
joomdonation - comment - 24 Feb 2024

PR #42869 should address this issue. Please test it if you can. Thanks !

Add a Comment

Login with GitHub to post a comment