Refresh Package
Permalink
I'm working on a package with a lot of blocks and database tables.
The db.xml is within the package because most tables are shared across different blocks. When I now update the db.xml I have to remove the package including all blocks and reinstall it.
This is a bit ugly since it also removes all the block instances...
Is there a way to refresh a package?
The db.xml is within the package because most tables are shared across different blocks. When I now update the db.xml I have to remove the package including all blocks and reinstall it.
This is a bit ugly since it also removes all the block instances...
Is there a way to refresh a package?
thanks!
But wouldn't it be nice if there's a "refresh" button on the package as well?
But wouldn't it be nice if there's a "refresh" button on the package as well?
there is :)
you can get an instance of the package by Package::getByHandle('scow')->upgrade() but then call parent upgrade in your package controller which will refresh the package.
The quick cheater way is to minimally increment the package version in the controller then go to add functionality, update addons, then click upgrade. It does a version compare so just remember to bring the version way back down to 1.0 or whatever is applicable in your case before releasing it.
you can get an instance of the package by Package::getByHandle('scow')->upgrade() but then call parent upgrade in your package controller which will refresh the package.
The quick cheater way is to minimally increment the package version in the controller then go to add functionality, update addons, then click upgrade. It does a version compare so just remember to bring the version way back down to 1.0 or whatever is applicable in your case before releasing it.
thanks a lot Scott!
The version trick is fine. I'm not going to release the package and having a huge minor version number is okay..
But adding a button would probably still be useful? There's always a workaround but it seems like I'm not the first person who run into this problem.
The version trick is fine. I'm not going to release the package and having a huge minor version number is okay..
But adding a button would probably still be useful? There's always a workaround but it seems like I'm not the first person who run into this problem.
Hi Remo,
yeah the button is a nice way of doing it as well. I am sure you can probably load the controller and post directly to that, or alternatively in your form you could have an upgrade button that submits a form to your controller you're already using. There you would have a function like upgrade_package(){
}
yeah the button is a nice way of doing it as well. I am sure you can probably load the controller and post directly to that, or alternatively in your form you could have an upgrade button that submits a form to your controller you're already using. There you would have a function like upgrade_package(){
Loader::model('Package'); $pkg = Package::getByHandle('remo_package')->upgrade(); $this->set('message',t('Package has successfully been upgraded'));
}
Looking for any beta testers for the bock? may be late in, but whould love to work with it.
Frank
Frank
what package?
"dbee" is the name of my package. This reloads the db.xml of the package (not the blocks!). But handle with care: this could delete all your data...