No Code Attached Yet bug
avatar ceford
ceford
30 Sep 2022

Steps to reproduce the issue

This is a report from a user that his hosting service has disallowed the PHP set_time_limit() function in PHP 8.1.

https://forum.joomla.org/viewtopic.php?f=808&t=996843

I have looked through the Joomla code and see that most calls are preceded by @ but one instance checks for the existence of the function. What we need to know is whether to treat this as a bug or to advise the user to move to a different hosting service.

Expected result

Actual result

System information (as much as possible)

Additional comments

avatar ceford ceford - open - 30 Sep 2022
avatar ceford ceford - change - 30 Sep 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 30 Sep 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Sep 2022
avatar brianteeman
brianteeman - comment - 30 Sep 2022

The host simply does not understand the purpose of that function. Disabling it actually makes the issue they are trying to resolve worse.

avatar brianteeman
brianteeman - comment - 30 Sep 2022

Note that wordpress will also fail if that function is disabled

avatar Webdongle
Webdongle - comment - 1 Oct 2022

I have looked through the Joomla code and see that most calls are preceded by @ but one instance checks for the existence of the function

Is that inconsistent?

avatar SharkyKZ
SharkyKZ - comment - 21 Dec 2022

Is that inconsistent?

No. If it's accepted that set_time_limit() is the kind of function that could be disabled (which is very sensible for shared hosting), all instances should be wrapped in in function_exists() checks while still maintaining error suppression. This is because in PHP 8 calling a disabled function throws an Error which can not be suppressed, only caught. Previously only a warning was emitted.

avatar Webdongle
Webdongle - comment - 21 Dec 2022

so is set_time_limit() wrapped in function_exists() ? If not is that what is causing the issue?

avatar SharkyKZ
SharkyKZ - comment - 22 Dec 2022

Yes, that's what's causing the issue.

avatar Webdongle
Webdongle - comment - 22 Dec 2022

So why has nobody edited the code in Joomla so thatset_time_limit() is wrapped in function_exists() ?

avatar zero-24
zero-24 - comment - 22 Dec 2022

Could be it was not reported before that there are issues like this my hoster for example also dont block that. Feel free to create a PR or look where that calles are missing so someone else can take a look and do the PR :)

avatar brianteeman
brianteeman - comment - 22 Dec 2022
avatar ReLater
ReLater - comment - 22 Dec 2022

2cents:

  • Core code is trying to suppress the error by a nowadays unreliable/useless/error throwing @ to avoid using class_exists(). Means: Programmers were aware that not all hosts support set_time_limit() and that it is just a nice-to-have at this code place.
  • It's a Joomla bug that it doesn't work anymore like before.
  • If we leave it as it is, set_time_limit() should have been documented as a technical requirement of J!4.
    • Joomla should not expect that hosts will change their server configuration.
    • As long as we are talking about easily to fix things we shouldn't tell users that they have to change their hosting service.
  • For the sake of consistency and code clarity @ should be replaced in core code at several places.

BTW: Using set_time_limit() at this code place is a bit questionable from my point of view.

avatar Webdongle
Webdongle - comment - 22 Dec 2022

... Feel free to create a PR or look where that calles are missing so someone else can take a look and do the PR :)

If I could I would but that is beyond me.

avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023
avatar Hackwar Hackwar - change - 25 Aug 2023
Labels Added: PBF
avatar Hackwar Hackwar - labeled - 25 Aug 2023
avatar brianteeman brianteeman - change - 30 Aug 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-08-30 07:39:30
Closed_By brianteeman
avatar brianteeman brianteeman - close - 30 Aug 2023
avatar brianteeman
brianteeman - comment - 30 Aug 2023

see #41523

avatar brianteeman brianteeman - change - 30 Aug 2023
Labels Removed: PBF
avatar brianteeman brianteeman - unlabeled - 30 Aug 2023

Add a Comment

Login with GitHub to post a comment