(English) concrete5.7 upgrade packages

Leider ist der Eintrag nur auf English verfügbar.




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’

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);
}
}

}

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *