Great tutorial on updating packages for 5.7. Very helpful. Minor observation – I guess the resulting package isn’t backwards compatible any more so perhaps the $appVersionRequired property in the package controller should be set to ‘5.7.0’
Never mind, apparently they are now called “handle” and “name”
The core team has a task to fix the backup/restore functionality in 5.7: https://github.com/concrete5/concrete5-5.7.0/issues/571.
5.7 uses doctrine instead of adodb to access the database, that’s why this part needs to be rewritten..
ccm_launchFileManager is not defined!!
what is the 5.7 equivalent??
No idea, would have to investigate too..
Thanks for this! I’m new to C5 and was working on creating my first package, and this covered a key point that the official tutorial did not.
9 Comments
Great tutorial on updating packages for 5.7. Very helpful. Minor observation – I guess the resulting package isn’t backwards compatible any more so perhaps the $appVersionRequired property in the package controller should be set to ‘5.7.0’
Thanks! I’ve changed it on git (https://github.com/Remo/concrete5-zoom-image/commit/611c2eb2100b5e11961bd03bdae40fa988652f42) but forgot to update the post..
Adding the backup/restore capability in 5.7 would be convenient.
More details would also be helpful. For instance, porting the Cobalt package is giving me difficulty:
controller.php now contains:
And yet on installation it complains about ptName:
An exception occurred while executing ‘insert into PageTypes (ptName, ptHandle, ptDefaultPageTemplateID, ptAllowedPageTemplates, ptIsInternal, ptLaunchInComposer, ptDisplayOrder, ptIsFrequentlyAdded, pkgID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)’ with params [null, null, 0, “A”, 0, 0, “1”, 0, “7”]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘ptName’ cannot be null
Forgot to chop the php tag out first:
namespace Concrete\Package\Cobalt;
defined(‘C5_EXECUTE’) or die(_(“Access Denied.”));
use PageTheme;
use PageType;
use PageTemplate;
class Controller extends \Concrete\Core\Package\Package {
protected $pkgHandle = ‘cobalt’;
protected $appVersionRequired = ‘5.7.0’;
protected $pkgVersion = ‘2.0’;
public function getPackageDescription() {
return t(“Cobalt is a responsive business theme for C5 that integrates Foundation Framework CSS.”);
}
public function getPackageName() {
return t(“Cobalt”);
}
public function install() {
$pkg = parent::install();
// Install Theme
PageTheme::add(‘cobalt’, $pkg);
// Install Page Types
if(!is_object(PageTemplate::getByHandle(‘homepage’))) {
$data[‘ptHandle’] = ‘homepage’;
$data[‘ptName’] = t(‘Homepage’);
$hpt = PageType::add($data, $pkg);
}
}
}
Never mind, apparently they are now called “handle” and “name”
The core team has a task to fix the backup/restore functionality in 5.7: https://github.com/concrete5/concrete5-5.7.0/issues/571.
5.7 uses doctrine instead of adodb to access the database, that’s why this part needs to be rewritten..
ccm_launchFileManager is not defined!!
what is the 5.7 equivalent??
No idea, would have to investigate too..
Thanks for this! I’m new to C5 and was working on creating my first package, and this covered a key point that the official tutorial did not.