Umbraco-CMS
Umbraco-CMS copied to clipboard
Content delivery API returns incorrect language version for multinode treepicker used inside shared blocklist field
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
12.3.3
Bug summary
In a multilingual setup, when a content type has a shared blocklist field, which element type contains a multinode treepicker, this content queried from Content Delivery API in some cases returns incorrect language version of the item.
Specifics
We faced this issue on a project using Umbraco v12.2.0, however I was also able to reproduce it in the latest v12.3.3 in a clean installation. Please refer to the steps below.
Steps to reproduce
Create the following types:
- Create content type Author (allow vary by culture)
- Firstname (text string, vary by culture)
- Lastname (text string, vary by culture)
- Create element type Authors block (does NOT allow vary by culture)
- Key (text string)
- Authors (multinode treepicker of Author type)
- Create content type Article (allow vary by culture)
- Author (multinode treepicker of Author type, shared)
- Authors 1 (blocklist of Authors block, shared)
- Authors 2 (blocklist of Authors block, vary by culture)
Create the following content in 2 languages (en-US, and de-DE for example):
- Author 1 (Author):
- en-US: "Author 1 (en)"
- Firstname: "Test (en)"
- Lastname: "Test (en)"
- de-DE: "Author 1 (de)"
- Firstname: "Test (de)"
- Lastname: "Test (de)"
- en-US: "Author 1 (en)"
- Article 1 (Article):
- en-US: "Article 1 (en)"
- Author: select Author 1
- Authors, create a block in a blocklist
- Key: "Test"
- Authors: select Author 1
- Authors 2, create a block in a blocklist
- Key: "Test (en)"
- Authors: select Author 1
- de-DE: "Article 1 (de)"
- (shared)
- (shared)
- Authors 2, create a block in a blocklist
- Key: "Test (de)"
- Authors: select Author 1
- en-US: "Article 1 (en)"
Save and publish all the content above however, don't query it via Content Delivery API yet.
Test case 1:
- query en-US version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/en/article-1-en/?expand=all
- then query de-DE version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/de/article-1-de/?expand=all
Clear nuCache and restart!
Test case 2: 1 query de-DE version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/de/article-1-de/?expand=all 2. then query en-US version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/en/article-1-en/?expand=all
Working theory: when Umbraco caches the contents of a shared blocklist field containing multinode treepicker in nuCache, it adds to the cache the first requested language version of content selected in a treepicker.
Expected result / actual result
Test case 1.1 (everything is correct):
- Expected result
- en-US version of Article 1 containing en-US content of Author 1 is returned with the following fields:
- Author: Author 1 (en)
- Authors 1: Author 1 (en)
- Authors 2: Author 1 (en)
- en-US version of Article 1 containing en-US content of Author 1 is returned with the following fields:
- Actual result
- en-US version of Article 1 containing en-US content of Author 1 is returned with the following fields:
- Author: Author 1 (en)
- Authors 1: Author 1 (en)
- Authors 2: Author 1 (en)
- en-US version of Article 1 containing en-US content of Author 1 is returned with the following fields:
Test case 1.2 (Authors 2 field contains en-US content of Author 1 instead of de-DE):
- Expected result
- de-DE version of Article 1 containing de-DE content of Author 1 is returned with the following fields:
- Author: Author 1 (de)
- Authors 1: Author 1 (de)
- Authors 2: Author 1 (de)
- de-DE version of Article 1 containing de-DE content of Author 1 is returned with the following fields:
- Actual result
- de-DE version of Article 1 is returned with the following fields mixing de-DE and en-US content of Author 1:
- Author: Author 1 (de)
- Authors 1: Author 1 (en) <-- Incorrect!
- Authors 2: Author 1 (de)
- de-DE version of Article 1 is returned with the following fields mixing de-DE and en-US content of Author 1:
Test case 2.1 (everything is correct):
- Expected result
- de-DE version of Article 1 containing de-DE content of Author 1 is returned with the following fields:
- Author: Author 1 (de)
- Authors 1: Author 1 (de)
- Authors 2: Author 1 (de)
- de-DE version of Article 1 containing de-DE content of Author 1 is returned with the following fields:
- Actual result
- de-DE version of Article 1 containing de-DE content of Author 1 is returned with the following fields:
- Author: Author 1 (de)
- Authors 1: Author 1 (de)
- Authors 2: Author 1 (de)
- de-DE version of Article 1 containing de-DE content of Author 1 is returned with the following fields:
Test case 2.2 (Authors 2 field contains en-US content of Author 1 instead of de-DE):
- Expected result
- en-US version of Article 1 containing en-US content of Author 1 is returned with the following fields:
- Author: Author 1 (en)
- Authors 1: Author 1 (en)
- Authors 2: Author 1 (en)
- en-US version of Article 1 containing en-US content of Author 1 is returned with the following fields:
- Actual result
- en-US version of Article 1 is returned with the following fields mixing en-US and de-DE content of Author 1:
- Author: Author 1 (en)
- Authors 1: Author 1 (de) <-- Incorrect!
- Authors 2: Author 1 (en)
- en-US version of Article 1 is returned with the following fields mixing en-US and de-DE content of Author 1:
This item has been added to our backlog AB#36178
Hi there @diger74!
Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.
We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
- We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
- If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
- We'll replicate the issue to ensure that the problem is as described.
- We'll decide whether the behavior is an issue or if the behavior is intended.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.
Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:
I cannot reproduce this, but funnily enough, its because I hit another bug.. π
In test case 2, (after restarting) and trying to query my variant content, it just gives me a 404 until i load the default language π€
Hi @Zeegaan, thanks for the prompt response and your investigation, appreciate it. This new bug is strange indeed, I haven't seen such a thing before, haha
Please find my vanilla local test solution attached (v12.3.3) with this issue replicated, just run it with dotnet run and query URLs from test case 1 and 2, then notice authorS attribute in the response. There are 2 languages: en-US and de-DE and only 3 content items in the tree.
Umbraco admin creds just in case username: admin@localhost password: Qwerty123!!
Test case 1:
- query en-US version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/en/article-1-en/?expand=all
- then query de-DE version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/de/article-1-de/?expand=all
Clear nuCache and restart!
Test case 2:
- query de-DE version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/de/article-1-de/?expand=all
- then query en-US version of Article 1 via Content Delivery API with ?expand=all option, like this: https://localhost:44354/umbraco/delivery/api/v1/content/item/en/article-1-en/?expand=all
Hey!
I took a go at the issue. And I was able to reproduce it! But I was unable to get the same bug as @Zeegaanπ. I'll go ahead and mark this issue as a sprint candidate.
@andr317c thanks for the update! hopefully, you will be able to resolve this quickly.
Hi @andr317c,
Hope you had a nice Christmas break! Do you have any ETA on a resolution of this issue, please?
Hey, I hope you also had a great Holiday! The issue is on our taskboard! π But there is no official ETA yet.
Confirmed as an issue for us also on Umbraco 12.3.3 @andr317c on a Umbraco/Umbraco Commerce build that went into production recently. Is there any movement on this yet. Is it worth us trying a PR maybe? π
Hi everyone. Sorry for the lack of activity here. I'll be looking into this very soon.
Fixed in https://github.com/umbraco/Umbraco-CMS/pull/15828
Did the bug that @Zeegaan raised get addressed? I am seeing exactly the same thing at the moment, difference is that I am using the accept-language header param. If I save the content node in umbraco in the non-default language, postman then gives me a 404, if I change to the default language then resend, then change back to the non-default language it works again.