? ? ? Pending

User tests: Successful: Unsuccessful:

avatar NunoLopes96
NunoLopes96
14 Aug 2017

Introduction

Currently when you have a problem in the Core Database (com_admin / installation tables) if there is any error you can fix it in the Extensions -> Manage -> Database, where it can show if you have any error in the database and which is.
The same doesn’t happen when you install a extension and you have problem on it, with this feature you can fix the extension without needing to re-install or even use queries in the joomla database.

Summary of Changes

Improvement of the Extensions -> Manage -> Database view for fixing now not only the core Joomla database but also 3rd party extensions

Testing Instructions

You can test with any feature:

  1. Try to change the version_id of an extension in #__schemas
  2. Try to change the version in manifest_cache in #__extensions
  3. Try to drop any table related to your extension or change any column

To check the problems get your pointer over in the Errors column, a tooltip will pop

Here is an example of my extension:
https://github.com/NunoLopes96/component_joomla

Use this query:

update #__schemas set version_id='0.0.12' where extension_id='10000'; (in my case)
drop table #__students;

After selecting my component the table came back again and the fix was successful

Expected result

screenshot from 2017-08-02 17-17-49

There will be 3 types of badge in Errors column in the table:
Success : There are no Problems on the database
Warning : There are only errors related to versions (Database schema or Update version) and non in the database.
Danger : There are errors on the database

For more information on the problems you can pass your mouse over the Errors:
screenshot from 2017-08-02 14-53-21

note: This extension has their Update Version and Database Schema version correct but still there are errors in the database

screenshot from 2017-08-02 14-52-51
note: There are no errors in the database, only the Database Schema version and the Update Version are incorrect, still you can fix this.

Actual result

screenshot from 2017-07-03 02-27-10

Documentation Changes Required

avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2017
Category Administration com_installer Language & Strings
avatar NunoLopes96 NunoLopes96 - open - 14 Aug 2017
avatar NunoLopes96 NunoLopes96 - change - 14 Aug 2017
Status New Pending
avatar NunoLopes96 NunoLopes96 - change - 14 Aug 2017
The description was changed
avatar NunoLopes96 NunoLopes96 - edited - 14 Aug 2017
avatar NunoLopes96 NunoLopes96 - change - 14 Aug 2017
Labels Added: ? ?
avatar laoneo
laoneo - comment - 5 Apr 2018

Can you fix the conflicts here and then we need some tests. Nice addon for extension developers!

avatar roland-d
roland-d - comment - 21 May 2018

@laoneo I have fixed the conflicts and updated the files to use namespaces where possible.

avatar roland-d
roland-d - comment - 21 May 2018

@Quy Thank you for the extra checking. All issues have been addressed.

avatar laoneo
laoneo - comment - 22 May 2018

I have tested this item successfully on 7e50ed8


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

avatar laoneo laoneo - test_item - 22 May 2018 - Tested successfully
avatar laoneo
laoneo - comment - 22 May 2018

Nice work and something I was looking for since the db fixer got added to the core. Thanks @roland-d for the fixes and @NunoLopes96 for your work on this.

avatar alikon
alikon - comment - 27 May 2018

I have tested this item successfully on 7e50ed8


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

avatar alikon alikon - test_item - 27 May 2018 - Tested successfully
avatar Quy Quy - change - 27 May 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 27 May 2018

RTC


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

avatar laoneo
laoneo - comment - 28 May 2018

Is it really necessary to use the session to store variables? From a quick glance the state of the model should be used for that or even defined variables in the model.
The model also compiles to much of HTML code. Would be nice to find a way to avoid that. Also get rid of the 700 extension (obviously I do miss here something).

The rest looks ok, and I would be happy to get that merged.

avatar roland-d roland-d - change - 28 May 2018
Labels Added: ?
avatar roland-d
roland-d - comment - 28 May 2018

@laoneo

Is it really necessary to use the session to store variables?

I don't know :) My first priority was to bring the code in-sync with the 4.0-dev branch. I can see if we can do this different.

The model also compiles to much of HTML code. Would be nice to find a way to avoid that.

I am thinking we can do this with a layout.

Also get rid of the 700 extension (obviously I do miss here something).

Yes, as mentioned earlier this is the ID of the Joomla core. This is used throughout the core to identify the core files. Issue #20500 you mentioned, also seems to state we can keep this. For now I want to keep this ID until we have a solid solution for changing this.

avatar roland-d
roland-d - comment - 3 Jun 2018

@laoneo I have addressed all the issues you have raised. Can you have another look please?

avatar laoneo laoneo - change - 9 Jun 2018
Labels Removed: ?
avatar laoneo
laoneo - comment - 9 Jun 2018

Looks nice now, you could even get rid of the hardcoded 700 extension id and the session storage. Hope some of the testers like @Quy or @alikon test again, so that we can merge it.

avatar laoneo laoneo - change - 9 Jun 2018
Labels Added: ?
avatar Quy
Quy - comment - 9 Jun 2018

Select all and click the Fix button.

17537

An error has occurred.

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '4.0.0-2018-03-05')' at line 3 

Call stack
# 	Function 	Location
1 	() 	JROOT\libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php:135
2 	Joomla\Database\Mysqli\MysqliStatement->__construct() 	JROOT\libraries\vendor\joomla\database\src\Mysqli\MysqliDriver.php:874
3 	Joomla\Database\Mysqli\MysqliDriver->prepareStatement() 	JROOT\libraries\vendor\joomla\database\src\DatabaseDriver.php:1755
4 	Joomla\Database\DatabaseDriver->setQuery() 	JROOT\administrator\components\com_installer\Model\DatabaseModel.php:457
5 	Joomla\Component\Installer\Administrator\Model\DatabaseModel->fixSchemaVersion() 	JROOT\administrator\components\com_installer\Model\DatabaseModel.php:258
6 	Joomla\Component\Installer\Administrator\Model\DatabaseModel->fix() 	JROOT\administrator\components\com_installer\Controller\DatabaseController.php:58
7 	Joomla\Component\Installer\Administrator\Controller\DatabaseController->fix() 	JROOT\libraries\src\MVC\Controller\BaseController.php:710
8 	Joomla\CMS\MVC\Controller\BaseController->execute() 	JROOT\libraries\src\Dispatcher\Dispatcher.php:161
9 	Joomla\CMS\Dispatcher\Dispatcher->dispatch() 	JROOT\libraries\src\Dispatcher\LegacyDispatcher.php:71
10 	Joomla\CMS\Dispatcher\LegacyDispatcher->dispatch() 	JROOT\libraries\src\Component\ComponentHelper.php:350
11 	Joomla\CMS\Component\ComponentHelper::renderComponent() 	JROOT\libraries\src\Application\AdministratorApplication.php:106
12 	Joomla\CMS\Application\AdministratorApplication->dispatch() 	JROOT\libraries\src\Application\AdministratorApplication.php:149
13 	Joomla\CMS\Application\AdministratorApplication->doExecute() 	JROOT\libraries\src\Application\CMSApplication.php:368
14 	Joomla\CMS\Application\CMSApplication->execute() 	JROOT\administrator\includes\app.php:38
15 	require_once() 	JROOT\administrator\index.php:36 
avatar Quy
Quy - comment - 9 Jun 2018

In PHP error log:

PHP Notice:  Undefined offset: 10000 in \administrator\components\com_installer\Model\DatabaseModel.php on line 254
PHP Notice:  Undefined index: extension in \administrator\components\com_installer\Model\DatabaseModel.php on line 258
PHP Notice:  Trying to get property 'extension_id' of non-object in \administrator\components\com_installer\Model\DatabaseModel.php on line 258
avatar roland-d
roland-d - comment - 10 Jun 2018

@laoneo @Quy Thanks for the review. I have fixed all except the one I don't understand :)

The PHP notices are gone as well as they related to the fatal error that was shown.

avatar roland-d
roland-d - comment - 10 Jun 2018

@alikon Thank you, query has been cleaned up.

avatar Quy
Quy - comment - 10 Jun 2018

When going to the list, it shows no results. You have to use the filters to see entries.

avatar Quy
Quy - comment - 10 Jun 2018

Remeber after any changes click "Find Problems" to refresh the cache

I don't see the Find Problems button.

avatar roland-d roland-d - change - 11 Jun 2018
The description was changed
avatar roland-d roland-d - edited - 11 Jun 2018
avatar roland-d
roland-d - comment - 11 Jun 2018

@Quy All changes are done and the empty list has been fixed.

I don't see the Find Problems button.

In one of the earlier iterations of fixes this has been removed as it is no longer needed. I have removed it from the test instructions.

avatar roland-d
roland-d - comment - 11 Jun 2018

@Quy Do you know if there is anything better for this message:
image

This doesn't look very nice. Such a short sentence is already wrapped as well.

avatar brianteeman
brianteeman - comment - 11 Jun 2018

Even if you make it shorter in English to prevent it wrapping it may still wrap in other languages

avatar roland-d
roland-d - comment - 11 Jun 2018

@brianteeman I understand that, was more wondering if there is a new design/classes/functions to be used or if this is how it is at the moment in J4.

avatar brianteeman
brianteeman - comment - 11 Jun 2018

Ah. Iirc they are still being decided

avatar laoneo
laoneo - comment - 11 Jun 2018

I hope this alert boxes will get a restyle in the new template anyway, so we should not bother about being wrapped for now. As long as you do Factory::getApplication()->enqueueMessage, you should be fine.

avatar brianteeman
brianteeman - comment - 11 Jun 2018

What is the purpose of "select status" as there is no status displayed in the table
chrome_2018-06-11_10-12-06

avatar brianteeman
brianteeman - comment - 11 Jun 2018

We need a no results found message when you have filtered and got no results. (For consistency)

chrome_2018-06-11_10-13-24

avatar brianteeman
brianteeman - comment - 11 Jun 2018

Does it need to say "update version" - isn't it enough to simply say "version"

I found the word "update" a little confusing

avatar roland-d
roland-d - comment - 12 Jun 2018

@brianteeman I have removed the word Update and I added the No items found message. As for the Status filter, it was there when I took over this PR. I guess it comes from the Manage view. Now I wonder if this filter has any use. If we are going to keep it, I can add the Status column to this list, otherwise we can just remove this filter.

avatar roland-d
roland-d - comment - 12 Jun 2018

@Quy Thanks, all issues have been addressed.

avatar brianteeman
brianteeman - comment - 12 Jun 2018

Unless I miss something I can't see any reason to have the status column. Not even sure it makes sense even if you put it back. For example a component never has a status of anything other than enabled or disabled

avatar brianteeman
brianteeman - comment - 12 Jun 2018

Really looking forward to this being in core

avatar roland-d
roland-d - comment - 12 Jun 2018

The status filter has been removed.

avatar roland-d
roland-d - comment - 12 Jun 2018

@Quy I styled all columns the same way as the Extension -> Manage page. The title looks a little odd but not sure if this is OK. Please have a look and let me know if it needs any changing.

avatar Quy
Quy - comment - 12 Jun 2018

Looks good! ? One last change would be to replace Description with the title name in the popover. It is like that on Manage page (tooltip needs to be changed to popover).

avatar Quy
Quy - comment - 12 Jun 2018

Should it be Version in #__schemas?

schema

avatar roland-d
roland-d - comment - 12 Jun 2018

@Quy Made the Description change.

Should it be Version in #__schemas?

I have named it Database Schema Version so you know which version is being talked about as this is specific.

avatar Quy
Quy - comment - 12 Jun 2018

Search in extension name. Prefix with ID: to search for an extension ID.

Searching on ID:700 results in Unknown column 'schemas.update_site_id' in 'where clause'

avatar roland-d
roland-d - comment - 12 Jun 2018

@Quy Not so crazy, that field doesn't exist :P I pushed the fixed for that.

avatar roland-d
roland-d - comment - 13 Jun 2018

@Quy You are merciless ? I will fix them tonight.

avatar roland-d
roland-d - comment - 13 Jun 2018

@Quy above issues fixed and some more changes for cleanup.

avatar roland-d
roland-d - comment - 14 Jun 2018

@Quy There must be 3 spaces after the param otherwise CS check fails.

avatar Quy
Quy - comment - 15 Jun 2018

For the Errors column, should the badges be Errors and not Problems?

In the screenshot, there is a horizontal line between the problem(s) and the stats, but this is not case.

avatar roland-d
roland-d - comment - 15 Jun 2018

@Quy I have aligned the wording. To me the word Problems is better than Errors because the issues don't have to error out the site. The site can function properly even though you have database problems.

avatar Quy
Quy - comment - 15 Jun 2018

Fix language string

problems

avatar Quy Quy - test_item - 15 Jun 2018 - Tested successfully
avatar Quy
Quy - comment - 15 Jun 2018

I have tested this item successfully on 7e50ed8

THANK YOU!


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

avatar laoneo laoneo - test_item - 16 Jun 2018 - Tested successfully
avatar laoneo
laoneo - comment - 16 Jun 2018

I have tested this item successfully on 7e50ed8


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

avatar laoneo
laoneo - comment - 16 Jun 2018

Thank you guys very much for the hard work in the last days. Really appreciated!

avatar laoneo laoneo - close - 16 Jun 2018
avatar laoneo laoneo - merge - 16 Jun 2018
avatar laoneo laoneo - change - 16 Jun 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-06-16 08:05:13
Closed_By laoneo

Add a Comment

Login with GitHub to post a comment