cherrycoding Posted October 2, 2019 Share Posted October 2, 2019 Hi Guys, I have a strange problem if I add some simple html code (some divs and a link) I get this error on save: Notice: Undefined variable: previewUrl Symfony\Component\Debug\Exception\ContextErrorException in src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php (line 299) [ 'cmsPageForm' => $form->createView(), 'cmsCategoryParentId' => $request->get('id_cms_category'), 'enableSidebar' => true, 'help_link' => $this->generateSidebarLink($request->attributes->get('_legacy_controller')), 'previewUrl' => $previewUrl, 'cmsUrl' => $this->get('prestashop.adapter.shop.url.cms_provider') ->getUrl($cmsPageId, '{friendy-url}'), ] ); } If I delete this code I can save the page. Does anybody have an idea about the issue? Thanks Regards, Alex Link to comment Share on other sites More sharing options...
juliodiaz Posted November 4, 2019 Share Posted November 4, 2019 I have the same trouble: CRITICAL php Undefined variable: previewUrl CRITICAL request Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined variable: previewUrl" at /var/www/dev-toshiba/src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php line 299 Link to comment Share on other sites More sharing options...
cherrycoding Posted November 4, 2019 Author Share Posted November 4, 2019 Hi, I've updated to PS 1.7.6.1 and problem was fixed (it's in the changelog). Regards, Alex Link to comment Share on other sites More sharing options...
juliodiaz Posted November 4, 2019 Share Posted November 4, 2019 Thanks!!! Link to comment Share on other sites More sharing options...
rewuxiin Posted February 25, 2020 Share Posted February 25, 2020 On 11/4/2019 at 10:24 PM, cherrycoding said: Hi, I've updated to PS 1.7.6.1 and problem was fixed (it's in the changelog). Regards, Alex PS.1.7.6.3 - the same problem Quote Undefined variable: previewUrl if i add <iframe></iframe> Link to comment Share on other sites More sharing options...
nicolasvdk Posted March 1, 2020 Share Posted March 1, 2020 Hi, I've the same problem on PS 1.7.6.3.... Link to comment Share on other sites More sharing options...
Gipielle Posted March 8, 2020 Share Posted March 8, 2020 Same problem with Prestashop 1.7.6.3 and 1.7.6.2 Link to comment Share on other sites More sharing options...
Gipielle Posted March 8, 2020 Share Posted March 8, 2020 Solved, the problem is in the ps_cms table, upgrade updating from old versions of prestashop, the table is not updated correctly, the indexation column is missing and there is an additional id_shop column fixing the table everything works. 1 Link to comment Share on other sites More sharing options...
rewuxiin Posted March 9, 2020 Share Posted March 9, 2020 8 hours ago, Gipielle said: Solved, the problem is in the ps_cms table, upgrade updating from old versions of prestashop, the table is not updated correctly, the indexation column is missing and there is an additional id_shop column fixing the table everything works. Thanks, but my table is correct Link to comment Share on other sites More sharing options...
Gipielle Posted March 10, 2020 Share Posted March 10, 2020 On 3/9/2020 at 8:28 AM, rewuxiin said: Thanks, but my table is correct Check other ps_cms tables, comparing them to a clean version of prestashop. Link to comment Share on other sites More sharing options...
rewuxiin Posted March 11, 2020 Share Posted March 11, 2020 (edited) On 3/10/2020 at 12:36 PM, Gipielle said: Check other ps_cms tables, comparing them to a clean version of prestashop. I have a clean version of Prestashop 1.7.6.3. I have not updated Solved src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php Taken out of the try construct /** @var EditableCmsPage $editableCmsPage */ $editableCmsPage = $this->getQueryBus()->handle(new GetCmsPageForEditing($cmsPageId)); $previewUrl = $editableCmsPage->getPreviewUrl(); Edited March 11, 2020 by rewuxiin (see edit history) Link to comment Share on other sites More sharing options...
Gipielle Posted March 11, 2020 Share Posted March 11, 2020 Perfect ! Link to comment Share on other sites More sharing options...
Klemart3D Posted April 9, 2020 Share Posted April 9, 2020 Hi, I've you tried, in General settings to : - switch ON "Allow iFrames" ? - switch OFF "Use HTMLPurifier library" ? And disable debug mode on Performances page. For me it works on PS 1.7.6.4. Move previous code out try construct was giving me following: Quote An unexpected error has occurred. [PrestaShop\PrestaShop\Core\Domain\CmsPage\Exception\CmsPageException code 0] Link to comment Share on other sites More sharing options...
Jezza Posted October 2, 2020 Share Posted October 2, 2020 On 3/11/2020 at 11:14 AM, rewuxiin said: I have a clean version of Prestashop 1.7.6.3. I have not updated Solved src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php Taken out of the try construct /** @var EditableCmsPage $editableCmsPage */ $editableCmsPage = $this->getQueryBus()->handle(new GetCmsPageForEditing($cmsPageId)); $previewUrl = $editableCmsPage->getPreviewUrl(); Life saver ! Thanks Link to comment Share on other sites More sharing options...
Pianetasvapo Posted May 15, 2021 Share Posted May 15, 2021 This is my error, can you help me? CRITICAL php Uncaught Notice: Undefined variable: cmsPageCategoryForm CRITICAL request Uncaught PHP Exception SymfonyComponentDebugExceptionContextErrorException: "Notice: Undefined variable: cmsPageCategoryForm" at /public_html/src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php line 404 Corrisponding at: 'cmsPageCategoryForm' => $cmsPageCategoryForm->createView(), Thanks all of you who help me Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now