joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

[5.2] Task freezes/ locks if external functions has warning/ deprecated messages #44430

Open Rmh1978 opened 2 weeks ago

Rmh1978 commented 2 weeks ago

Steps to reproduce the issue

Call a task where a external function has a warning/ deprecated message.

Expected result

Either Knockout or succes.

Actual result

Task freezes and is locked

System information (as much as possible)

Joomla 5.2

Additional comments

I have a external function in my component that is triggered in the task function. My external function calls another function that had these messages. That causes the Task to freeze and getting set to locked. My function is still executed correct but the Task is locked and i need to remove the lock in the db.

Warning : Undefined array key "src" in /libraries/xxx/src/Helper/Mail.php on line 89

Deprecated : strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /libraries/xxx/src/Helper/Mail.php on line 99

Deprecated : str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in /libraries/xxx/src/Helper/Mail.php on line 100

My fix was to set isset: if (isset($image['src'])) { $images[] = $image['src']; }

But the task should not freeze when the external function still executes succesfully. I use try catch on triggering the function and Knockout on catch.