Open LinneaHarts opened 2 months ago
I found this error was in the NeoFieldTranslator.php file, trying to send a title into the Neo blocks. Not sure why that was added in Crart 5, but removing it fixed this issue.
I've found a number of other issues with field handles though.
Thank you for the quick follow-up.
We initially discovered this bug but were unsure if it was specific to neo field or more widespread. However, your confirmation has been helpful. The plan is to push a fix for this tomorrow.
Can you describe the issues you're experiencing with field handles?
Because Craft 5 created so many more field handles (and it seems like they are not always stored consistently) I was getting errors when I created new orders, saying, for instance "field handle cta3 not found". I added a try catch block in HyperLinkFieldTranslator and AssetFieldTranslator to handle the errors I saw, but there may be others. I haven't tested entries with every field type.
https://github.com/imarc/craft-translations/blob/f7db5162c1098d5637d59f2b3ffa0a3af2a47e60/src/services/fieldtranslator/HyperLinkFieldTranslator.php#L31 https://github.com/imarc/craft-translations/blob/a7407e219d734babdd623ef7a0d3a6f19591d2ae/src/services/fieldtranslator/AssetsFieldTranslator.php#L28
(I'm maintaining a separate fork that has a ChatGPT connector for a client -- who is paying for the license -- so I've been debugging myself.)
Thank you for the detailed information. We'll continue working on this and communicate with you in this ticket.
Hi @LinneaHarts, we have a new beta release v4.0.0-beta.2
that should fix your issue.
I can't test if this will work because it can't create an order without also giving an "Invalid field handle" error for any new fields that Craft 5 created.
Sorry, this was because I hadn't converted my SuperTable fields yet. I was able to successfully create an order. Now trying to process it!
No, this is still having the same problem with applying drafts. I'm getting invalid field handles and the only way to fix it is using craft's merge capabilities, but that causes other problems.
Hi @LinneaHarts, thank you for your patience as we refine the Craft 5 beta.
Could you share some specific steps to reproduce the issue you're experiencing? Screenshots or screen recordings are very helpful for our team to identify and resolve more quickly.
Hello @LinneaHarts, I wanted to follow up here on @sidedwards request.
I'm afraid I'm not a great example because I do maintain a separate branch of the plugin to add a ChatGPT translator. I fixed my own issues on this particularly client site by using Craft's merge command on the fields it was complaining about, as well as adding this code to the field translators.
try {
$blocks = $element->getFieldValue($field->handle);
$fieldHandle = $field->handle;
} catch (\Exception $e) {
$blocks = $element->getFieldValue(preg_replace('/\d+$/', '', $field->handle));
$fieldHandle = preg_replace('/\d+$/', '', $field->handle);
}
@LinneaHarts - it looks like this may has been resolved, do you mind testing this again on your end?
Hi @LinneaHarts - just following up here again
I just got a chance to test this yesterday. I think it's working! Bearing in mind that I merged your update into my own fork. Thanks!
I just got a chance to test this yesterday. I think it's working! Bearing in mind that I merged your update into my own fork. Thanks!
Great, thank you @LinneaHarts, feel free to open another ticket if you run into any other complications.
Actually, with further testing, there may be something going on. Stand by
No, the problem is persisting. It is having trouble with hyper fields at the moment, perhaps others.
No, the problem is persisting. It is having trouble with hyper fields at the moment, perhaps others.
@LinneaHarts - we'll continue looking into this.
If we need any more information from you, like steps for repro, we'll touch base here.
I do have it more-or-less working on this fork/branch https://github.com/imarc/craft-translations/tree/chatgpt-craft5
When I did a merge on the offending field using the fields/merge command, I was able to merge, but now it's creating a new revision that removes all the content in the source language.
I was able to fix this by adding the following code from line 100-112 https://github.com/imarc/craft-translations/blob/chatgpt-craft5/src/services/repository/EntryRepository.php#L100
@LinneaHarts thank you for the update. We will investigate this further and review your proposed solution. Thanks for your patience on this issue 🙏
@LinneaHarts, would you mind testing this again with the latest version to see if that resolves your issue? The code you mentioned above is included here:
Hi @LinneaHarts, just following up here on @sidedwards' comment. Let me know if this resolves your issue
When trying to Merge and Apply a Draft, I keep getting a "title" array key not found error. There is a Craft 5 release of this out, but the Craft 5 support ticket hasn't been closed yet, so I'm confused if this release is ready or not.