Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

component paragraph fails to render in frontend #22

Closed
roman204 opened this issue Sep 27, 2019 · 11 comments
Closed

component paragraph fails to render in frontend #22

roman204 opened this issue Sep 27, 2019 · 11 comments

Comments

@roman204
Copy link

The class
\MageSuite\ContentConstructorFrontend\Model\Component\Paragraph
seems to be a copy of
\MageSuite\ContentConstructorFrontend\Model\Component\StaticBlock
in line 30 of the Paragraph Class there is an error thrown cause the Paragraph Component doesn't have a index named "blockId" in the var $configuration.

public function getContent() {
        $configuration = $this->getData();

        $id = isset($configuration['blockId']) ? $configuration['blockId'] : $configuration['identifier'];

        $block = $this->blockFactory->createBlock(
            \Magento\Cms\Block\Block::class,
            [
                'data' => [
                    'block_id' => $id
                ]
            ]
        );

        return $block->toHtml();
    }
@Hoargarth
Copy link

Yesterday we've updated Magesuite to its latest 3.* Version and we still have this Problem.
Is there any workaround for this until it gets fixed?

@krzksz
Copy link

krzksz commented Oct 15, 2019

Hello, thank you for your report. We haven't really encountered such an error so far, but I'll forward it to our backend devs to investigate.

@krzksz
Copy link

krzksz commented Oct 15, 2019

We've checked it internally and are not able to reproduce this issue on our newest environments.
Can you please provide the versions of creativestyle/magesuite-content-constructor-frontend and creativestyle/magesuite-content-constructor-admin packages along with the exact reproduction path for this bug?

@Hoargarth
Copy link

Thank you for looking into this

magesuite-content-constructor-frontend: v2.15.0
magesuite-content-constructor-admin: v2.9.2
(both versions as stated in composer.lock in M2 root folder)

How to reproduce:

  1. Go to any CMS page
  2. In content add paragraph-component
  3. Add some paragraph content and save paragraph
  4. Save CMS page
  5. Refresh page in frontend, error appears and breaking the whole page

So nothing special that could break the component

Stacktrace:
`1 exception(s):
Exception #0 (Exception): Notice: Undefined index: identifier in /htdocs/vendor/creativestyle/magesuite-content-constructor-frontend/Model/Component/Paragraph.php on line 30

Exception #0 (Exception): Notice: Undefined index: identifier in /htdocs/vendor/creativestyle/magesuite-content-constructor-frontend/Model/Component/Paragraph.php on line 30

#1 MageSuite\ContentConstructorFrontend\Model\Component\Paragraph->getContent() called at [vendor/creativestyle/magesuite-content-constructor-frontend/view/frontend/templates/component/paragraph.phtml:17]
#2 include('/Users/...') called at [vendor/magento/framework/View/TemplateEngine/Php.php:59]
#3 Magento\Framework\View\TemplateEngine\Php->render(&MageSuite\ContentConstructorFrontend\Block\Component\Paragraph\Interceptor#000000002945be05000000004bcb6785#, '/Users/...', array()) called at [vendor/magento/framework/View/Element/Template.php:271]
#4 Magento\Framework\View\Element\Template->fetchView('/Users/...') called at [generated/code/MageSuite/ContentConstructorFrontend/Block/Component/Paragraph/Interceptor.php:167]
#5 MageSuite\ContentConstructorFrontend\Block\Component\Paragraph\Interceptor->fetchView('/Users/...') called at [vendor/magento/framework/View/Element/Template.php:301]
#6 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1094]
#7 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1098]
#8 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:671]
#9 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [generated/code/MageSuite/ContentConstructorFrontend/Block/Component/Paragraph/Interceptor.php:492]
#10 MageSuite\ContentConstructorFrontend\Block\Component\Paragraph\Interceptor->toHtml() called at [vendor/creativestyle/magesuite-content-constructor-frontend/Block/Component.php:107]
#11 MageSuite\ContentConstructorFrontend\Block\Component->_toHtml() called at [generated/code/MageSuite/ContentConstructorFrontend/Block/Component/Interceptor.php:37]
#12 MageSuite\ContentConstructorFrontend\Block\Component\Interceptor->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1094]
#13 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1098]
#14 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:671]
#15 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [generated/code/MageSuite/ContentConstructorFrontend/Block/Component/Interceptor.php:323]
#16 MageSuite\ContentConstructorFrontend\Block\Component\Interceptor->toHtml() called at [vendor/magento/framework/View/Layout.php:557]
#17 Magento\Framework\View\Layout->_renderBlock('component0fca') called at [vendor/magento/framework/View/Layout.php:533]
#18 Magento\Framework\View\Layout->renderNonCachedElement('component0fca') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#19 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('component0fca') called at [vendor/magento/framework/View/Layout.php:488]
#20 Magento\Framework\View\Layout->renderElement('component0fca', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#21 Magento\Framework\View\Layout\Interceptor->renderElement('component0fca', false) called at [vendor/magento/framework/View/Layout.php:585]
#22 Magento\Framework\View\Layout->_renderContainer('content', false) called at [vendor/magento/framework/View/Layout.php:535]
#23 Magento\Framework\View\Layout->renderNonCachedElement('content') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#24 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content') called at [vendor/magento/framework/View/Layout.php:488]
#25 Magento\Framework\View\Layout->renderElement('content', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#26 Magento\Framework\View\Layout\Interceptor->renderElement('content', false) called at [vendor/magento/framework/View/Layout.php:585]
#27 Magento\Framework\View\Layout->_renderContainer('main', false) called at [vendor/magento/framework/View/Layout.php:535]
#28 Magento\Framework\View\Layout->renderNonCachedElement('main') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#29 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main') called at [vendor/magento/framework/View/Layout.php:488]
#30 Magento\Framework\View\Layout->renderElement('main', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#31 Magento\Framework\View\Layout\Interceptor->renderElement('main', false) called at [vendor/magento/framework/View/Layout.php:585]
#32 Magento\Framework\View\Layout->_renderContainer('columns', false) called at [vendor/magento/framework/View/Layout.php:535]
#33 Magento\Framework\View\Layout->renderNonCachedElement('columns') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#34 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns') called at [vendor/magento/framework/View/Layout.php:488]
#35 Magento\Framework\View\Layout->renderElement('columns', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#36 Magento\Framework\View\Layout\Interceptor->renderElement('columns', false) called at [vendor/magento/framework/View/Layout.php:585]
#37 Magento\Framework\View\Layout->_renderContainer('main.content', false) called at [vendor/magento/framework/View/Layout.php:535]
#38 Magento\Framework\View\Layout->renderNonCachedElement('main.content') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#39 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content') called at [vendor/magento/framework/View/Layout.php:488]
#40 Magento\Framework\View\Layout->renderElement('main.content', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#41 Magento\Framework\View\Layout\Interceptor->renderElement('main.content', false) called at [vendor/magento/framework/View/Layout.php:585]
#42 Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:535]
#43 Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#44 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper') called at [vendor/magento/framework/View/Layout.php:488]
#45 Magento\Framework\View\Layout->renderElement('page.wrapper', false) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#46 Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false) called at [vendor/magento/framework/View/Layout.php:585]
#47 Magento\Framework\View\Layout->_renderContainer('root', false) called at [vendor/magento/framework/View/Layout.php:535]
#48 Magento\Framework\View\Layout->renderNonCachedElement('root') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
#49 Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root') called at [vendor/magento/framework/View/Layout.php:488]
#50 Magento\Framework\View\Layout->renderElement('root', true) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
#51 Magento\Framework\View\Layout\Interceptor->renderElement('root') called at [vendor/magento/framework/View/Layout.php:954]
#52 Magento\Framework\View\Layout->getOutput() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#53 Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', array()) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#54 Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#55 Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', array(), array(array('layout-model-cac...'))) called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:494]
#56 Magento\Framework\View\Layout\Interceptor->getOutput() called at [vendor/magento/framework/View/Result/Page.php:258]
#57 Magento\Framework\View\Result\Page->render(&Magento\Framework\App\Response\Http\Interceptor#000000002945b303000000004bcb6785#) called at [vendor/magento/framework/View/Result/Layout.php:171]
#58 Magento\Framework\View\Result\Layout->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000002945b303000000004bcb6785#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#59 Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', array(&Magento\Framework\App\Response\Http\Interceptor#000000002945b303000000004bcb6785#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#60 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Response\Http\Interceptor#000000002945b303000000004bcb6785#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#61 Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', array(&Magento\Framework\App\Response\Http\Interceptor#000000002945b303000000004bcb6785#), array(array('result-messages', 'result-builtin-c...', 'result-varnish-c...'))) called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130]
#62 Magento\Framework\View\Result\Page\Interceptor->renderResult(&Magento\Framework\App\Response\Http\Interceptor#000000002945b303000000004bcb6785#) called at [vendor/magento/framework/App/Http.php:141]
#63 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#64 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261]
#65 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000002945b308000000004bcb6785#) called at [index.php:39]

Let me know if you need any additional info

@mborkowski
Copy link

Hi,
So it seems you have the newest creativestyle/magesuite-content-constructor-frontend but outdated creativestyle/magesuite-content-constructor-admin package. Please update to the latest 2.16.5 and this issue should be gone.
The problem is in package sync. We have changed the logic of Paragraph component recently. Since 2.16.0 was released we no longer save paragraph content to static block, and therefore we don't need identifier field anymore. In the newest version of admin package we, at first, check if paragraph was saved before this code change or after. In your case paragraph is saved after the code change but because of outdated creativestyle/magesuite-content-constructor-admin package this additional check is not there, therefore this method is looking for an identifier of CMS block, instead of just return content of textarea provided in admin panel.
Please let us know if this update did the job.

@Hoargarth
Copy link

Hoargarth commented Oct 22, 2019

So we've tried it again with updating and now everything is working fine as expected, thank you.

Just a note for you (and for others to save them some time)
You said our content-constructor-admin is not up to date, but we guess you meant to update content-constructor-frontend.

Another note, with an ordinary update we could not get the newest version for content-constructor-fronted and were stuck on v2.15.0.
So we had to force the update.
Not sure if this problem comes from our side or not.

Thank you again.

@wmdkdkussin
Copy link

We have the same issue with a just installed MageSuite.io v3.0.0 on a clean Magento v2.3.3 with a couple extensions from Amasty and MageSetup.

And if we try to update creativestyle/magesuite-frontend or creativestyle/magesuite-content-constructor-frontend then we get dependency errors.

How can we solve them?

Thank you.

picture620-1
picture597-2
picture597-3

@roman204
Copy link
Author

roman204 commented Nov 6, 2019

we got it working by require the following modules

    "creativestyle/magesuite": "^3.0.0",
    "creativestyle/magesuite-content-constructor-frontend": "2.16.5",
    "creativestyle/magesuite-content-constructor-admin": "2.10.0"

@wmdkdkussin
Copy link

Thank you, but I still get the following errors:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for creativestyle/magesuite-content-constructor-frontend 2.16.5 -> satisfiable by creativestyle/magesuite-content-constructor-frontend[v2.16.5].
    - creativestyle/magesuite-content-constructor-frontend v2.16.5 requires creativestyle/magesuite-dynamic-directives ^1.0.0 -> no matching package found.
  Problem 2
    - creativestyle/magesuite v3.0.0 requires creativestyle/magesuite-content-constructor-frontend ^2.0.0 -> satisfiable by creativestyle/magesuite-content-constructor-frontend[v2.16.5].
    - creativestyle/magesuite v3.0.0 requires creativestyle/magesuite-content-constructor-frontend ^2.0.0 -> satisfiable by creativestyle/magesuite-content-constructor-frontend[v2.16.5].
    - creativestyle/magesuite-content-constructor-frontend v2.16.5 requires creativestyle/magesuite-dynamic-directives ^1.0.0 -> no matching package found.
    - Installation request for creativestyle/magesuite ^3.0.0 -> satisfiable by creativestyle/magesuite[v3.0.0].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Have you installed with --ignore-platform-reqs?

@diwipl
Copy link
Contributor

diwipl commented Nov 7, 2019

Sorry, we forgot to add some new packages to packagist. I've added them now, please check.

@wmdkdkussin
Copy link

Thanks alot. Now, it ist working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants