? ? ? Success

User tests: Successful: Unsuccessful:

avatar andrepereiradasilva
andrepereiradasilva
5 Apr 2016

Pull Request for Issue #8512.

Summary of Changes

After updating Joomla and extensions a lot of times (since 1.7) we get a lot of obsolete update sites from domain changes, url changes, etc that extension developers forget to delete on uninstall.

This makes searching for updates more slow. Right now we can disable the update sites, but we cannot delete or even rebuild the update sites table.

This PR adds two new options to com_installer updates sites view: delete and rebuild

  • delete: deletes an update site (joomla core updates sites cannot be deleted)
  • rebuild: the update sites are rebuild from the manifest files.

Testing Instructions

  1. Use latest staging
  2. Apply this patch
  3. Go to "Extensions -> Manage -> Update Sites"
  4. Notice the two new buttons image
  5. Try to Rebuild the update sites and check if everything is fine.
  6. Install some extensions with update sites of all the types you can imagine (libraries, templates, plugin, modules, components, etc).
  7. Repeat step 5 and check if everything is fine.
  8. Delete some update sites (the 4 core joomla update sites will not be allowed to delete) the others you can delete.
  9. Repeat step 5 and check if everything is fine.

Observations

Code revisions, improvements and suggestions are welcomed.

avatar andrepereiradasilva andrepereiradasilva - open - 5 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 5 Apr 2016
Labels Added: ? ?
7284ff1 5 Apr 2016 avatar andrepereiradasilva cs
avatar brianteeman brianteeman - change - 5 Apr 2016
Labels
avatar brianteeman brianteeman - change - 5 Apr 2016
Category Installation Multilanguage
avatar andrepereiradasilva andrepereiradasilva - change - 5 Apr 2016
Labels
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

ok still need some changes here, plus resolving the plural forms.

discovered some bugs. will tell when ready.

avatar infograf768
infograf768 - comment - 7 Apr 2016

@andrepereiradasilva

I suggest to slightly change the constants for the plural strings, i.e adding _N_
from

+COM_INSTALLER_MSG_UPDATESITES_DELETE_UPDATESITES_DELETED="%s update sites have been deleted."
+COM_INSTALLER_MSG_UPDATESITES_DELETE_UPDATESITES_DELETED_1="1 update site has been deleted."

to

+COM_INSTALLER_MSG_UPDATESITES_DELETE_N_UPDATESITES_DELETED="%s update sites have been deleted."
+COM_INSTALLER_MSG_UPDATESITES_DELETE_N_UPDATESITES_DELETED_1="1 update site has been deleted."
avatar brianteeman
brianteeman - comment - 7 Apr 2016

Thanks @infograf768 that was what I had suggested before the N

avatar brianteeman brianteeman - test_item - 7 Apr 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 7 Apr 2016

I have tested this item :white_check_mark: successfully on 17db21e

Tested delete
Tested rebuild
Added fake updates sites in the db and rebuild removed them

All good (once the language string key is updated)


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

avatar brianteeman brianteeman - change - 7 Apr 2016
Labels
avatar brianteeman brianteeman - change - 7 Apr 2016
Category Installation Multilanguage Installation Language & Strings
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

please don't test yet i has some bugs still.
i'm trying to solve them.

avatar brianteeman
brianteeman - comment - 7 Apr 2016

Really? Every test I could think of worked

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

problems still to solve (that i know of):

  • the en-GB package, if somehow deleted, doesn't get the update (because it does not have an extension in the database ...).
  • also had to do an additional check if the extension is only discovered or it's really installed.
  • plural variables name
avatar brianteeman
brianteeman - comment - 7 Apr 2016

the en-GB package, if somehow deleted, doesn't get the update (because it does not have an extension in the database ...).

Accredited Joomla! Translations update site cannot be deleted.

In addition its a protected extension so cant be deleted

avatar brianteeman brianteeman - change - 7 Apr 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-04-07 15:35:40
Closed_By brianteeman
avatar brianteeman brianteeman - close - 7 Apr 2016
avatar brianteeman brianteeman - change - 7 Apr 2016
Status Closed New
Closed_Date 2016-04-07 15:35:40
Closed_By brianteeman
avatar brianteeman brianteeman - change - 7 Apr 2016
Status New Pending
avatar brianteeman brianteeman - reopen - 7 Apr 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

@brianteeman
After some investigation and with the help form @infograf768 the en-GB language problem is something not related to this PR.

Explaining, for what i know, and correct me if i'm wrong:

A language package install 3 extensions in the database:

  • type = language | Admin
    • Manifest: /administrator/language/xx-XX/xx-XX.xml
  • type = language | Site
    • Manifest: /language/xx-XX/xx-XX.xml
  • type = package | Site
    • Manifest: /administrator/manifests/packages/pkg_xx-XX.xml

The en-GB language pack (comes by default) somehow only has two extensions in the database...

  • type = language | Admin
    • Database Id: 601
    • Manifest: /administrator/language/en-GB/en-GB.xml
  • type = language | Site
    • Database Id: 600
    • Manifest: /language/en-GB/en-GB.xml
  • type = package | Site
    • Database Id: doesn't exist
    • Manifest: /administrator/manifests/packages/pkg_en-GB.xml

See https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql#L618-L619

Since the update servers are declared in the pkg manifest, if somehow deleted, will not be reconstructed in this PR.
Of course this is a wild scenario, since deleting it is not possible through the update sites view.

So this is not related to this PR, this PR does not readd the en-GB update site after "accidental" delete because, as said, the pkg_en-GB extension does not exist, by default, in joomla database.

But from a coherence point of view, if a manifest exists, the extension should exist in the database.

In other words, IMHO it should exist a blocked en-GB package extension in the database on joomla install and the udpate site should point to that extension (as all language packs do).

Remember you have blocked extension in the database for all other manifest files, including joomla core, joomla update, etc.

avatar brianteeman
brianteeman - comment - 7 Apr 2016

Not 100% sure I understand your last sentence but as for the rest it really is beyond the scope of this PR

avatar infograf768
infograf768 - comment - 7 Apr 2016

@brianteeman
What @andrepereiradasilva says is that this PR will work perfectly if we add in our sqls the Database Id: for the en-GB fake pack (in _extensions).
If not done, this PR may let people delete the en-GB entry in updatesite by mistake. This would be an issue if someone has never installed a lang pack and does it for the first time after deleting it.
Just a matter of adding to joomla.sql and updates sql the fake pkg.
I guess :)

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

yes, it's out of the scope of this PR.

Remember you have blocked extension for all other manifest files, including joomla core, joomla update, etc.

Some examples:

Joomla Core: All logic

Joomla Update: All logic

en-GB language package: ?

Something doesn't seem right ...

Put ok, let's concentrate in the PR and check that later.

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

What @andrepereiradasilva says is that this PR will work perfectly if we add in our sqls the Database Id: for the en-GB fake pack (in _extensions).

Yes, but in another PR.

If not done, this PR may let people delete the en-GB entry in updatesite by mistake. This would be an issue if someone has never installed a lang pack and does it for the first time after deleting it.

This PR doesn't allow to delete any update site that has update.joomla.org in the URI.
See https://github.com/andrepereiradasilva/joomla-cms/blob/update-sites-manage/administrator/components/com_installer/models/updatesites.php#L366

Just a matter of adding to joomla.sql and updates sql the fake pkg.

Not only, the update site extension id should be linked en-Gb package too (since it's in the en-GB package manifest that exists the update server URI).

avatar brianteeman
brianteeman - comment - 7 Apr 2016

As this PR does not allow you to delete that update site I really think its a non-issue

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

Yes, it's not an issue because of the special treatment that exists in en-GB, it's just an inconsistency i discovered in this PR.

I will not fix this is this PR. So let's concentrate in this PR.

Will do the rest of the changes and tell when is finished.

avatar joomla-cms-bot
joomla-cms-bot - comment - 7 Apr 2016

This PR has received new commits.

CC: @brianteeman


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

avatar joomla-cms-bot
joomla-cms-bot - comment - 7 Apr 2016

This PR has received new commits.

CC: @brianteeman


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

avatar joomla-cms-bot
joomla-cms-bot - comment - 7 Apr 2016

This PR has received new commits.

CC: @brianteeman


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Apr 2016

ok, now should be ok.

avatar brianteeman
brianteeman - comment - 7 Apr 2016

I dont understand the comment about a discovered extension not being installed. If I click on discover and install an extension then it is installed and if it has an update server in the xml it is added to the update sites


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

avatar brianteeman
brianteeman - comment - 7 Apr 2016

I realise now you meant not to parse the extensions that are listed in Discover but have not been installed yet


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

avatar brianteeman brianteeman - test_item - 7 Apr 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 7 Apr 2016

I have tested this item :white_check_mark: successfully on 4d26e51


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

avatar brianteeman brianteeman - change - 8 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 8 Apr 2016
Labels
avatar brianteeman brianteeman - change - 14 Apr 2016
Milestone Added:
avatar conconnl conconnl - test_item - 15 Apr 2016 - Tested successfully
avatar conconnl
conconnl - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 4d26e51

I have tested it successfully.
Installed an extension, deleted the Update Site and recreated it by using the rebuild function.
Afterwards removed extension and the Update Site was removed too.


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

avatar brianteeman brianteeman - change - 15 Apr 2016
Status Pending Ready to Commit
Labels
avatar brianteeman
brianteeman - comment - 15 Apr 2016

RTC


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

avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Added: ?
avatar insitevision insitevision - test_item - 15 Apr 2016 - Tested successfully
avatar insitevision
insitevision - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 4d26e51

Installed components, plugins, and template with update sites.
Followed the test instruction, deleted the update sites. After rebuild the update sites were succesfully recreated.


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

avatar rdeutz rdeutz - change - 2 May 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-05-02 06:06:57
Closed_By rdeutz
avatar brianteeman brianteeman - change - 11 May 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment