SOLVED: Extending EXISTING Package with new single_page
Permalink
Hi all!
How can I add a single_page to an existing package, without re-installing the package?
I am extending an existing package to add new functionality. I have created the necessary controllers, classes, pages and single_page, but I can't figure out how to install the single_page as part of the existing package.
I do not want to uninstall or re-install the package, as it has loads of data already and re-istalling it will yield lots of errors.
Any ideas welcome,
Best regards,
-Costa
How can I add a single_page to an existing package, without re-installing the package?
I am extending an existing package to add new functionality. I have created the necessary controllers, classes, pages and single_page, but I can't figure out how to install the single_page as part of the existing package.
I do not want to uninstall or re-install the package, as it has loads of data already and re-istalling it will yield lots of errors.
Any ideas welcome,
Best regards,
-Costa
maybe you could put something in the package constructor, that will check if the package is installed, and whether the single page has been installed, and if not, add it.
Good idea, but this will take quite a while, as the controller is quite complex and I would still need to avoid the parent install() method, as this would cause a lot of trouble.
Instead, I was looking for a kind of 'workaround' where I can perhaps add the single page by passing the package object.
However, I don't know how to execute the necessary code. Is there a way to upload a temporary page and execute it only once?
-Costa
Instead, I was looking for a kind of 'workaround' where I can perhaps add the single page by passing the package object.
However, I don't know how to execute the necessary code. Is there a way to upload a temporary page and execute it only once?
-Costa
hi Tony,
I have resolved it in a simple way:
I edited an existing dashboard page and added the following code:
I then executed the page and removed the code.
Thanks for replying
-Costa
I have resolved it in a simple way:
I edited an existing dashboard page and added the following code:
$pkg = Package::getByID(3); var_dump($pkg); Loader::model('single_page'); SinglePage::add('/dashboard/myPackage/comments', $pkg);
I then executed the page and removed the code.
Thanks for replying
-Costa