No Code Attached Yet bug
avatar brbrbr
brbrbr
28 Apr 2026

What happened?

I have an extension on my site with a 'checked_out' column that has no default value and is not NULLABLE. As aa result there is no DEFAULT value

Now the db->setQuery in Globalcheckin::makeCheckin throws a mysqli_sql_exception which is not caught.
the catch is on 'ExecutionFailureException'

Version

5.4

Expected result

Task continues on error and returns -2

Actual result

Task faills with error, not all checkins are executed depending on order in getTableList

'Run Task' shows 'No content was returned.'

System Information

No response

Additional Comments

the fix would be to move the setQuery into the try and change the catch to RuntimeException (parent of mysqli_sql_exception / ExecutionFailureException)

The exception is on the prepare statement in the constructor of MysqliStatement which has no try/catch at all. I wonder whether the error handling should be hardened there.

avatar brbrbr brbrbr - open - 28 Apr 2026
avatar brbrbr brbrbr - change - 28 Apr 2026
Labels Added: bug
avatar brbrbr brbrbr - labeled - 28 Apr 2026
avatar joomla-cms-bot joomla-cms-bot - change - 28 Apr 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Apr 2026
avatar chmst
chmst - comment - 1 May 2026

Wouldn't it be better if the extension developer adapts the extension?

avatar LadySolveig
LadySolveig - comment - 4 May 2026

To replicate your scenario, I have adjusted the table #__contact_details in line with the details you provided in the issue.

checked_out | int | no Default | not NULL

I had to work a bit of a workaround here in the store function, as the Joomla core doesn’t naturally support this.

public function store($updateNulls = true)

      if (empty($this->checked_out)) {
           $this->checked_out    = 0;
        }

As you can see here, the incorrect configuration for the column is neatly caught in the try-catch block and is later marked as unsuccessful in the task result, accompanied by a warning sign.
Image

The page is not broken and the error is highlighted as intended.
I regard this as the expected behaviour, and the column in the component should be adapted to match the conventions used in the two core components. Otherwise, it may lead to unwanted surprises, as is the case here.

Unfortunately, I was unable to reproduce the uncaught mysqli_sql_exception that you are describing.

avatar LadySolveig
LadySolveig - comment - 4 May 2026

To replicate your scenario, I have adjusted the table #__contact_details in line with the details you provided in the issue.

checked_out | int | no Default | not NULLABLE

I had to work a bit of a workaround here in the store function, as the Joomla core doesn’t naturally support this.

public function store($updateNulls = true)

      if (empty($this->checked_out)) {
           $this->checked_out    = 0;
        }

As you can see here, the incorrect configuration for the column is neatly caught in the try-catch block and is later marked as unsuccessful in the task result, accompanied by a warning sign.
Image

The page is not broken and the error is highlighted as intended.
I regard this as the expected behaviour, and the column in the component should be adapted to match the conventions used in the two core components. Otherwise, it may lead to unwanted surprises, as is the case here.

Unfortunately, I was unable to reproduce the uncaught mysqli_sql_exception that you are describing.

avatar LadySolveig
LadySolveig - comment - 4 May 2026

To replicate your scenario, I have adjusted the table #__contact_details in line with the details you provided in the issue.

Image

I had to work a bit of a workaround here in the store function, as the Joomla core doesn’t naturally support this.

public function store($updateNulls = true)

      if (empty($this->checked_out)) {
           $this->checked_out    = 0;
        }

As you can see here, the incorrect configuration for the column is neatly caught in the try-catch block and is later marked as unsuccessful in the task result, accompanied by a warning sign.
Image

The page is not broken and the error is highlighted as intended.
I regard this as the expected behaviour, and the column in the component should be adapted to match the conventions used in the two core components. Otherwise, it may lead to unwanted surprises, as is the case here.

Unfortunately, I was unable to reproduce the uncaught mysqli_sql_exception that you are describing.

avatar brbrbr
brbrbr - comment - 5 May 2026

Quite right that the fix for the checkout column is easily fixed in components table. The issue is probable not the checkin task but incomplete error handling in MysqliStatement, so the issue can be closed here.

Steps to reproduce:

CREATE TABLE #__checkout(idint(10) unsigned NOT NULL AUTO_INCREMENT,checked_outint(10) unsigned NOT NULL,checked_out_time datetime DEFAULT NULL, PRIMARY KEY (id) )

Now execute the Global Check-in task, The task while fail with a 'No content was returned' and the response will have a message "Field 'checked_out' doesn't have a default value.'

This is the result/message of a mysqli_sql_exception in the constructor of MysqliStatement. There the $this->statement is checked and it throws a PrepareStatementFailureException if it is not set, but does not catch and convert exceptions from $connection->prepare

` public function __construct(\mysqli $connection, string $query)
{
$this->connection = $connection;
$this->query = $query;

    $query = $this->prepareParameterKeyMapping($query);
   // try {  
    $this->statement  = $connection->prepare($query);
  // } catch(....) {
 // throw new PrepareStatementFailureException($this->connection->error, $this->connection->errno);

//}
if (!$this->statement) {
throw new PrepareStatementFailureException($this->connection->error, $this->connection->errno);
}
}
`

avatar LadySolveig
LadySolveig - comment - 5 May 2026

Thanks for the additional explanation. I’ll give that a new try later. If we can improve our error handling here, I think we should definitely give it a go.

Add a Comment

Login with GitHub to post a comment