Correct way to delete Packages?

Permalink
Is there a correct way to delete(uninstall) packages?

For instance: I installed and then uninstalled the 'AddThis' package. Then tried to reinstall it, but it was not appearing in the 'Add Functionality' console. I found the 'AddThis' database record still existed in the 'pakages' table. Once deleted I could then reinstall it.

Is this an oversight? Shouldn't uninstalling a package also remove it from the 'packages' table?

Essentially I am creating a package that involves single pages, tools, models and controllers. If the user wishes to uninstall my package it also needs to remove the single_pages, and still be able to reinstall it.

The 'package' model does not contain a delete(), so it makes no sense to call parent::delete() as you would in a BlockController. And if you put 'function delete()' into the package controller will it be called if the package is uninstalled?

Secondly what is the correct way to delete single pages? There is no facility to delete pages added in the dashboard. I'm assuming this would need to be coded with something like
Loader::model('page');
$p = Page::getByPath('singlepage');
$p->delete();


Loving the 5.3 release. Just means I now need to rework my gallery.

TravisN
 
frz replied on at Permalink Reply
frz
yeah removing packages in 5.3.1.1 is not as clean/right as it should be. That's already being addressed in the next version.
andrew replied on at Permalink Reply
andrew
1. We will be implementing an uninstall() method in a package. Uninstalling a package will remove it from the table, as well any blocks associated with the package. Everything else will probably remain. Individual package developers will then be able to implement an uninstall() method in their package, that will automatically run when it is uninstalled. This should happen in 5.3.2, which we want to release shortly.

2. The code you're running will work for removing a single page. However, if you want to just do it through the UI, it can be done. Just do it from the sitemap. If you don't see your single page in the sitemap (e.g. if it's a dashboard page) just click the "show system pages" checkbox. Then dashboard and system pages should appear. Just use the menu to delete the page (you'll probably have to be logged in as the admin user.)
warscdc replied on at Permalink Reply
Hello!
Write please what your most favourite game?
Half-Life 2,S.T.A.L.K.E.R.,F.E.A.R. 2,CALL of DUTY,Crysis ?

Games, prompt!
Greetings!
Who as considers. What computer game the most good?
1 place..........
2 place..........
3 place..........
4 place..........
5 place..........
frz replied on at Permalink Reply
frz
Hey I just got to use my troll badge! awesome!