Another Package Upgrade bug

Permalink 1 user found helpful
Hi,

I am upgrading a package from 5.6 to 8.3

I'm getting this error.
Unsupported operand types


I think it's because of one of the parameters on this call in the package controller.
$sp = \Page::add("/dashboard/sample_request", $this->pkg);


What should these parameters be?
Or where is the documentation on this call?

The only documentation I've found on this site is to add via the dashboard. And googling seems to only find things for versions prior to 5.7.

Oh, in 5.6 this call used to be:
$sp = SinglePage::add("/dashboard/sample_request", $this->pkg);

gwardell
 
hutman replied on at Permalink Best Answer Reply
hutman
I think you need to use this

use \Concrete\Core\Package\Package;
use \Concrete\Core\Page\Single as SinglePage;
$pkg = parent::install(); or $pkg = Package::getByHandle($this->pkgHandle);
$p = SinglePage::add(/dashboard/sample_request', $pkg);
if (is_object($p) && $p->isError() !== false) {
    $p->update(array('cName' => t('Sample Request')));
}
gwardell replied on at Permalink Reply
gwardell
That did it. I am not sure why.

Thanks :-)