[EXCONTRANS-373] Submitting batch fails with pages using the new spa prototype feature Created: 27/Apr/22  Updated: 09/Jun/22  Resolved: 09/Jun/22

Status: Closed
Project: Content Translation Extended (CTX)
Component/s: Core
Affects Version/s: 3.4.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Tobias Kerschbaum Assignee: Teresa Miyar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLCTS-151 Export translation file fails with pa... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

We use the new spa prototype feature in our sales demo. 

This results in the following configuration according to this documentation:

https://docs.magnolia-cms.com/product-docs/6.2/Templating/Template-definition.html#_common_template_properties

https://docs.magnolia-cms.com/product-docs/6.2/Templating/Site-definition/Template-prototype.html

 

for the site:

 

Sitename:
  [... normal stuff...] 
  templates:
    prototype:
      baseUrl: http://localhost:3000
      $type: spaPrototype
      dialog: headless-ecommerce:pages/Page
      routeTemplate: /{language}{{@path}}

 

for the page template itself:

 

title: bla
$type: siteSpa
areas:
  [... normal stuff...] 

 

 

 

When I add a page defined like mentioned above in a translation batch and submit, it is failing with the following error message:

2022-04-27 06:13:49,4502022-04-27 08:13:49,341 ERROR info.magnolia.commands.MgnlCommand : Execution is error, update to translation task item {}
2022-04-27 06:13:49,451info.magnolia.translation.ext.core.exception.CommandException: An exception occurred while creating the translation submission
2022-04-27 06:13:49,451 at info.magnolia.translation.ext.core.command.ExportTranslationCommand.createSubmissionItem(ExportTranslationCommand.java:256) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.translation.ext.core.command.ExportTranslationCommand.processResourceNodes(ExportTranslationCommand.java:179) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.translation.ext.core.command.ExportTranslationCommand.generateTranslationSubmission(ExportTranslationCommand.java:156) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.translation.ext.core.command.ExportTranslationCommand.executeOnItem(ExportTranslationCommand.java:128) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.translation.ext.core.command.AbstractTranslationCommand.execute(AbstractTranslationCommand.java:71) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.commands.MgnlCommand.executeSynchronized(MgnlCommand.java:80) ~[magnolia-core-6.2.18.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:69) ~[magnolia-core-6.2.18.jar:?]
2022-04-27 06:13:49,451 at info.magnolia.module.scheduler.CommandJob.execute(CommandJob.java:110) ~[magnolia-module-scheduler-2.3.6.jar:?]
2022-04-27 06:13:49,451 at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.3.2.jar:?]
2022-04-27 06:13:49,451 at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) ~[quartz-2.3.2.jar:?]
2022-04-27 06:13:49,451Caused by: java.lang.ClassCastException: class info.magnolia.module.site.templates.ConfiguredTemplateSettings cannot be cast to class info.magnolia.module.site.templates.ReferencingPrototypeTemplateSettings (info.magnolia.module.site.templates.ConfiguredTemplateSettings and info.magnolia.module.site.templates.ReferencingPrototypeTemplateSettings are in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @4b1c0397)
2022-04-27 06:13:49,452 at info.magnolia.translation.finder.DialogBasedPropertiesToTranslateFinder.getDialogFromPrototypeTemplate(DialogBasedPropertiesToTranslateFinder.java:144) ~[magnolia-content-translation-2.5.5.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.finder.DialogBasedPropertiesToTranslateFinder.determineDialogNames(DialogBasedPropertiesToTranslateFinder.java:125) ~[magnolia-content-translation-2.5.5.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.ext.core.finder.DialogBasedPropertiesToTranslateFinderExt.getPropertiesBasedOnDialogNames(DialogBasedPropertiesToTranslateFinderExt.java:98) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.ext.core.finder.DialogBasedPropertiesToTranslateFinderExt.getPropertiesToTranslate(DialogBasedPropertiesToTranslateFinderExt.java:86) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.finder.AdaptivePropertiesToTranslateFinder.getPropertiesToTranslate(AdaptivePropertiesToTranslateFinder.java:55) ~[magnolia-content-translation-2.5.5.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.io.ExportVisitor.visit(ExportVisitor.java:95) ~[magnolia-content-translation-2.5.5.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.jcr.util.NodeUtil.visit(NodeUtil.java:659) ~[magnolia-core-6.2.18.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.ext.core.io.ContentTransporterExt.exportContent(ContentTransporterExt.java:120) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,452 at info.magnolia.translation.ext.core.command.ExportTranslationCommand.createSubmissionItem(ExportTranslationCommand.java:221) ~[magnolia-content-translation-support-ext-core-3.4.4.jar:?]
2022-04-27 06:13:49,452 ... 9 more
2022-04-27 06:13:49,4522022-04-27 08:13:49,341 ERROR info.magnolia.module.scheduler.CommandJob : Cannot execute command [exportTranslationCommand] for job [UI Action triggered execution of [workflowTranslation:exportTranslationCommand] by user [jl3r2p5kplieoo3t]. (1)] in catalog [workflowTranslation] 

 



 Comments   
Comment by Riste Drangovski [ 27/Apr/22 ]

Hi Tobias,
I checked translation of page that inherits new spa prototype definition, but it works fine for me (all page content is exported and translated).
Based on the description in the ticket can it be that your site prototype definition is wrong ...
As far as I can see, this:

Sitename:
  [... normal stuff...] 
  templates:
    prototype:
      baseUrl: http://localhost:3000
      $type: spaPrototype
      dialog: headless-ecommerce:pages/Page
      routeTemplate: /{language}{{@path}} 

 should be:

Sitename:
  [... normal stuff...] 
  templates:
    class: info.magnolia.module.site.templates.ReferencingPrototypeTemplateSettings
    prototypeId: hareactdemo3:pages/Prototype/Prototype 

Can you please check if this is the problem or should I continue with my investigation ?

Comment by Tobias Kerschbaum [ 27/Apr/22 ]

Hey Riste,

I don't think we configured it wrong. Like described in the mentioned documentation, it is possible to use the new spaProtoype $type instead of the class. But I just found out also the normal content translation module has the same problem. So maybe the problem is not in the extended module, but in the translation core of magnolia. Therefore, I created the ticket https://jira.magnolia-cms.com/browse/MGNLCTS-151 and linked it to this one.

Comment by Teresa Miyar [ 09/Jun/22 ]

Fixed on core translations 2.5.7, it will be included with Magnolia 6.2.20

Generated at Mon Feb 12 00:30:36 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.