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

Error in cms listing page in the administration #16

Open
HB0N0 opened this issue Jan 14, 2025 · 3 comments
Open

Error in cms listing page in the administration #16

HB0N0 opened this issue Jan 14, 2025 · 3 comments

Comments

@HB0N0
Copy link

HB0N0 commented Jan 14, 2025

After opening the shopping experiences listing page (/#/sw/cms/index) in the administration I get the following error:

Uncaught (in promise) SyntaxError: Invalid argument
    createCompileError webpack-internal:///./node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js:68
    createI18nError webpack-internal:///./node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:118
    tc webpack-internal:///./node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:1095
    $tc webpack-internal:///./node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:2029
    getPageType webpack-internal:///./src/module/sw-cms/page/sw-cms-list/index.js:481
    ...

After that my shopware administration stops working until I reload the browser window.

Possible fix:

The error is caused by the new blog_detail page type introduced by this plugin. The listing page tries to translate the name of the cms pages and fails for blog_detail because the name and type ist not known to shopware.

My temporary fix is registering the new page type when the administration loads.

// on administration load
const cmsPageTypeService = Shopware.Service('cmsPageTypeService');
cmsPageTypeService.register({
    name: 'blog_detail',
    icon: '',
    title: "werkl-blog.blocks.blog.detail.label",
    class: [],
    hideInList: false,
});

Further informations:

  • While chasing down the error i discovered that shopware added a cms-aware flag in Shopware 6.5.x which should auto add custom cms-pages to the cmsPageTypeService in the administration.
  • If the plugin gets deactivated or uninstalled without deleting the database entries this error occurs too (I think this can only be fixed in the shopware main codebase or by renaming the blog_detail to a type known by shopware)
@7underlines
Copy link
Member

I attempted to reproduce the error but was unable to do so using Shopware 6.6.9.0, plugin version 4.2.0, and the Chrome browser. Are you perhaps using Shopware 6.5 with an older version of the plugin?

@phit
Copy link
Contributor

phit commented Jan 20, 2025

@7underlines you need to use the table view, not the grid view for the translation to be called, I'm getting the same issue on 6.6.9.0 and plugin version 4.2.0

the cms-aware flag seems to not catch because entities are apparently supposed to start with ce_ or custom_entity_, I don't think I've ever seen a plugin do that..

but that's stopping the page type from being registered here

https://github.com/shopware/shopware/blob/775f8af59dd280dee66ddc4762f227523f26605c/src/Administration/Resources/app/administration/src/app/init/repository.init.ts#L40-L61

@HB0N0
Copy link
Author

HB0N0 commented Jan 21, 2025

I am using Shopware 6.6.9.0 with Plugin Version 4.2.0 and the table view like @phit mentioned.
When switching to grid view it is working a expected.

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

3 participants