modifying a block table
Permalink
so, I am updating SimpleEvent to version 2.0 which will add a new column to the tables for categories. I have this working great and updating great using the dashboard updater. no problems at all there.
however, If I just drag and drop the new package via FTP and page refresh the site, the mysql blows up.
My question is, is this just a simple matter of me adding some sort of update function to the package controller, and C5 will see that and perform the same function? I've tried this on the block level, but this seems like a less than ideal way to do it.
my primary objective is a smooth transition.
however, If I just drag and drop the new package via FTP and page refresh the site, the mysql blows up.
My question is, is this just a simple matter of me adding some sort of update function to the package controller, and C5 will see that and perform the same function? I've tried this on the block level, but this seems like a less than ideal way to do it.
my primary objective is a smooth transition.
right. but as an "order of execute", as an end user, if I happen to upload that new folder with calls to the new data that isn't there yet while on a page of the site as opposed to the dashboard, then all kinds of nasty happen.
it's pretty seamless if done from the dashboard to begin with. but if you happen to load up the new files, and be on a page that uses that block...ugly shows up. I'm just wondering if there is a way to avoid that, or at least check the version number, and display a "HEY!!! GO TO YOUR DASHBOARD AND UPGRADE!"
it's pretty seamless if done from the dashboard to begin with. but if you happen to load up the new files, and be on a page that uses that block...ugly shows up. I'm just wondering if there is a way to avoid that, or at least check the version number, and display a "HEY!!! GO TO YOUR DASHBOARD AND UPGRADE!"
ah got ya!
Yes, this would be nice..
It might even be enough to override the view.php to print a message, in case the installed version isn't the same as the version in the controller.
Yes, this would be nice..
It might even be enough to override the view.php to print a message, in case the installed version isn't the same as the version in the controller.
not a big deal really unless a block update modifies the table structure. Then it is a big deal.
As a developer, I don't want to continually have to explain.."yeah..just make sure you don't view/use your site b4 going to your dashboard and updating the package, and you won't get that mysql error."
I almost tend to think this should be a core feature...if you have uploaded a later version of a block or package, the site is not usable until you go to the dashboard and update it.
As a developer, I don't want to continually have to explain.."yeah..just make sure you don't view/use your site b4 going to your dashboard and updating the package, and you won't get that mysql error."
I almost tend to think this should be a core feature...if you have uploaded a later version of a block or package, the site is not usable until you go to the dashboard and update it.
go to concrete/libraries/block_view.php,
around line 200 modify the code to look like this:
It's not a complete solution but it shows you how to compare the version and output a message if they aren't equal...
I had to create my own instance of "Package", couldn't get the version in the file easier. Would be nice if there's a solution without get_class.
around line 200 modify the code to look like this:
$btHandle = $obj->getBlockTypeHandle(); if (!isset($this->controller)) { $this->controller = Loader::controller($obj); } // begin remo $pkgID = $obj->pkgID; if($pkgID != 0) { $package = Package::getByID($pkgID); $versionInstalled = $package->getPackageVersion(); $packageName = get_class($package); $packageFile = new $packageName; $versionFile = $packageFile->getPackageVersion(); if ($versionInstalled != $versionFile) { echo 'Update needed! Dashboard link, auto update, whatever..'; return;
Viewing 15 lines of 23 lines. View entire code block.
It's not a complete solution but it shows you how to compare the version and output a message if they aren't equal...
I had to create my own instance of "Package", couldn't get the version in the file easier. Would be nice if there's a solution without get_class.
adodb xmlns is able to "merge" the structure automatically. No need for alter table statements!