No Code Attached Yet bug
avatar brianteeman
brianteeman
21 Apr 2023

Steps to reproduce the issue

On a site that needs updating
Make sure that your database structure is reporting an issue
eg edit the value of version_id in the #_schemas table

Try to update with the update component
You can not because of the database structure error which is a required check

Now try to update using the cli

`php cli/joomla.php core:update

Expected result

Update is not able to proceed because of the database structure issue

Actual result

Update takes place

Additional comments

Either the database structure check test is not important and shouldnt be required in the component OR the cli update should check the structure befiore installing.

I suspect the correct thing is the latter

avatar brianteeman brianteeman - open - 21 Apr 2023
avatar joomla-cms-bot joomla-cms-bot - change - 21 Apr 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Apr 2023
avatar richard67
richard67 - comment - 21 Apr 2023

I would say this applies to all required checks in the component.

avatar alikon
alikon - comment - 23 Apr 2023

what exactly do you mean ?
all that are present here

btw for the schema see #40461

avatar richard67
richard67 - comment - 23 Apr 2023

what exactly do you mean ? all that are present here

Yes.

btw for the schema see #40461

The schema check would also included in the above getPhpOptions method:

// Check if database structure is up to date
$option = new \stdClass();
$option->label = Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_TITLE');
$option->state = $this->getDatabaseSchemaCheck();
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_NOTICE');
$options[] = $option;

avatar alikon
alikon - comment - 23 Apr 2023

that's pretty unusable from CLI, it was introduced in 3.10 iirc, so...

avatar richard67
richard67 - comment - 23 Apr 2023

@alikon P.S.: Your PR #40461 just adds a check for the database schema version. But what the check in the component does with the $this->getDatabaseSchemaCheck() is that it runs the complete database check like the database checker does when you go to it. I.e. it does not only check for that error with not matching schema version but for any structure errors. The not matching schema version in Brian's issue was just an example how to make that test fail. So I think your PR #40461 is not really sufficient.

avatar alikon
alikon - comment - 23 Apr 2023

yes i know that, and it will imply a complete re-think of the whole "thing" on both sides

...1 small step at time...

avatar richard67
richard67 - comment - 23 Apr 2023

Well, but the PR does not completely solve the issue, it solves only a part, so that should be made clear in the description of that PR.

avatar alikon
alikon - comment - 23 Apr 2023

that's why i've not closed this ... i'll update the pr description too for avoid confusion ?

avatar richard67
richard67 - comment - 24 Apr 2023

The new PR #40468 for the core schema check works, I have just tested with success.

What remains are checks for the other required PHP & database settings from

:

  • PHP version >= minimum
  • ZLib compression support
  • PHP XML extension available
  • ...

Problem is that it needs to have fetched the update information before the check because some checks require that information, e.g. minimum PHP version or database supported.

avatar richard67 richard67 - change - 24 Apr 2023
Labels Added: bug
avatar richard67 richard67 - labeled - 24 Apr 2023

Add a Comment

Login with GitHub to post a comment