AcclaroInc / craft-translations

Easily manage your Craft CMS website translations and drive global growth with simplified translation workflows.
https://plugins.craftcms.com/translations
Other
9 stars 11 forks source link

Applying Translations Bug #478

Closed masonry47 closed 3 months ago

masonry47 commented 9 months ago

Hello!

We just updated to 3.3 and are still seeing some issues when trying to apply drafts. It seems to be related to this #463 . We do now get the proper notification that creation of the draft failed, but translations are not applying. We are logging

CreateDraft exception:: Attempting to save an element in an unsupported site.

Which we know means that the entry is just not enabled in the target site. We obviously can enable before applying the translation but we believe in previous versions that "merge into draft" or "merge and apply draft" would add the entry to the targeted site for you and then create the draft and apply.

Craft:4.5.5 Translations:3.3.0

Thanks!

shnsumit commented 9 months ago

@masonry47 We tried to reproduce the draft apply bug but seems this could be an edge case and we were not able to reproduce it at our end. Below are some scenarios that we tested in the debugging:

Tested propagation methods

Tested entry with fields

Question

Please check and share your reply, we will be happy to help here.

masonry47 commented 9 months ago

Thanks @shnsumit

This is an entry for a section with "Let each entry choose which sites it should be saved to." as the propagation method. The entry is created for the default site and has NOT been added to any of the other sites at the point of trying to apply translations. The field is a matrix field with nested fields (Redactor in this case) When applying in the Craft UI we get

Error: Creating Draft

In the log we get

2023-09-28 11:06:55 [translations.ERROR] [translations] [acclaro\translations\services\repository\EntryRepository::createDraft] CreateDraft exception:: Attempting to save an element in an unsupported site. {"memory":56093968} 
2023-09-28 11:06:55 [translations.ERROR] [translations] [acclaro\translations\controllers\OrderController::actionSaveDraftAndPublish] Couldn’t save the draft. Error: Exception: Creating draft. in /var/www/html/vendor/acclaro/translations/src/services/repository/EntryRepository.php:49

We did verify that if we "add" the entry to the site we are targeting before applying, the translations apply just fine. Is the answer that we just need to "Add" the entry to the targeted site before hand? From what we understood, in this scenario, the plugin handles that on the apply.

In testing other sections, it applies fine if the entry already exists in the targeted sites.

Do you want access to a dev environment? Or want us to send a video?

Thanks!

shnsumit commented 9 months ago

@masonry47

Do you want access to a dev environment? Or want us to send a video?

It would be really nice and helpful for us if you could share the dev environment access.

masonry47 commented 9 months ago

@shnsumit Is there a good email address for sending access info?

shnsumit commented 9 months ago

@shnsumit Is there a good email address for sending access info?

@masonry47 Yes, you can send it to sumit@semantic.dev

MerrittBoydston commented 8 months ago

@masonry47, I know you've been discussing this issue with @shnsumit but I wanted to leave a paper trail within the GitHub ticket.

Please let us know if @shnsumit's suggestion doesn't work or needs to be expanded upon.