1

We have a client website that has English (/en/) as a default language, and we've created other languages in preparation for translation and globalizing the site. We've turned on item level language fallback and field level language fallback. We've also turned on "Enforce Version Presence". One of the client requirements is to regionalize certain pieces of content so that only certain items show up within certain language/regions.

For our Spanish language, English is our language fallback and it is working correctly.

With Spanish (Mexico) selected, I've created a product page in Spanish (Mexico) (/es-mx/), and I can see the version just fine, however it also creates an English version (because it's the default language of the site?) and I can't find a way to remove the english version successfully.

I've Unchecked Enable Item Fallback and checked Enforce Version Presence, as well as made the English version unpublishable. I've been able to switch to the Web database and remove the English version, and everything works as expected, /en/product-page comes back as a 404, while the /es-mx/product-page displays as expected.

The moment I try to publish the Spanish version of the page, the English version gets re-created within the web database even with the English version marked as unpublishable, and it's now accessible through /en/product-page.

Is it possible this is a bug, or is this working as intended and I have to custom develop an alternate solution to get around this (item resolver pipeline?).

Edit: ** For clarity, I can successfully remove the English version when I'm on the master database using the standard select English language and click Remove - it even says the version is missing like it should, but once published the English version is NOT removed, and if I were to remove it manually in the web database (for testing purposes only), publishing Spanish only adds the English version right back.

Removed version from master & Published: Published master screenshot

Web still has english version: Web Version List

Something interesting I just noticed: When I re-select the master database (within desktop), and navigating back to the product page using the content editor, the english version now exists within the master database.

English version suddenly returns on master

If I repeat these steps:

  1. Make sure english is selected, remove english version by clicking Remove (I can verify in the language dropdown for the item that there is ONLY the spanish version, and I get the yellow notification "Current item does not have a version in English: English"

  2. click save

  3. navigate to a different item

  4. navigate back to the previous item - I can confirm that there is still only one Spanish version and no english version

  5. click the publish -> publish item dropdown

  6. select "Republish" and all of the rest of the checkmarks are checked (subitems, related items, English, French, Spanish) (I tried smart publish too with same result)

  7. navigate to another item

  8. navigate to the previous product item

  9. The English version has returned in the master database and I can see the English version in the list of language dropdown versions. ???

Something is causing the english version to return.

2 Answers 2

0

Ideally, as standard practice, we do not modify anything directly in a web database, Once you publish items from the master database it overwrites your web database changes.

You can remove the language version with the below steps:

  1. Go to the VERSIONS tab from the menu ribbon.
  2. Select language from the dropdown to switch language.

enter image description here

  1. Go to the item you want to remove version. let's say home item.
  2. Click on the item Remove button to delete the current version or click on the down arrow beside the button if you want to delete all the versions of specific items.

enter image description here

Check your role permission to access the appropriate menu. I'm having Admin access.

You can verify the below points to make it work.

  1. Make changes to enable enforceVersionPresence at the configuration level like enforceVersionPresence = "true".

In cases where there’s no version available for the requested language, this option allows you to tell Sitecore NOT to return an item. This will end up redirecting the user to a 404 (not found) page.

Check this article for more details: https://www.valtech.com/en-in/blog/language-fallback-in-sitecore-8.1/

<site name="mysite" patch:before="site[@name='website']"
            virtualFolder="/"
            physicalFolder="/"
            rootPath="/sitecore/content"
            startItem="/home"
            database="web"
            domain="extranet"
            allowDebug="true"
            cacheHtml="true"
            htmlCacheSize="50MB"
            enablePreview="true"
            enableWebEdit="true"
            enableDebugger="true"
            disableClientData="false"
            enforceVersionPresence = "true"
            />
  1. Enable Item Fallback and Enforce Version Presence at the template level (standard values) as those are shared fields. enter image description here

  2. Validate English item has 0 languages by clicking the language dropdown on the selected item and publish it.

enter image description here

Refer this for Language Fallback details; https://www.linkedin.com/pulse/sitecore-how-configure-language-fallback-why-md-arifuzzaman-arif

Hope it helps!

3
  • For 1. - I made sure the enableVersionPresence is at the configuration level, and I tested before and after to make sure the 404 is working as expect. For 2 - I don't want to enable these at the template level as I want to make sure language fallback is working for the rest of the product pages - I only want it to affect this specific product page. For 3 - Check my original post - I've originally made sure that on the master database that the english version did not exist and published it, yet it still created it EVEN if I only checked [x] Spanish as my publish target.
    – Qorey
    Commented Jan 6, 2023 at 15:12
  • I also tried making the english version unpublishable and every time I publish the spanish version only, it still creates an english version in the web database. The "Web" database modification was only to test to make sure that the 404 (Enforce Version Presence) was working, and I was using it merely as a testing scenario, not as a long term solution, if that makes sense.
    – Qorey
    Commented Jan 6, 2023 at 15:15
  • It could be custom events handlers or any custom pipeline that fired after publishing to create a version in English item. Commented Jan 7, 2023 at 2:12
0

I think you need to check how you have configured the enforceVersionPresence attribute. So as per the Sitecore documentation, Do not enable the enforceVersionPresence attribute on the shell or any other default site. You must enable the attribute on each of the relevant websites.

And then you need to enable enforce version presence on an item or a data template.

Refer this article.

https://doc.sitecore.com/xp/en/developers/92/sitecore-experience-manager/enforce-version-presence.html

4
  • I have configured it using a patch configuration file that modifies the "website" using <site name="website" set:enforceVersionPresence="true"> and I can see it within showconfig.aspx as well as tested it working as expected. I've read the documentation previously (and once again today) and specifically "When you enforce version presence of an item, the relevant translated language version of the item must be available for it to be returned from the API and displayed on the website." <- this is working.
    – Qorey
    Commented Jan 6, 2023 at 15:19
  • The problem is I cannot successfully remove the english version. Once I remove it, and publish it, the english version continues to exist in the Web database, even if I mark the english version as Unpublishable AND even if I only publish the Spanish version (uncheck english when I'm publishing the item)
    – Qorey
    Commented Jan 6, 2023 at 15:20
  • Also did you check if it is due to any workflow? Commented Jan 6, 2023 at 15:49
  • Good call, but I do not have any workflows created for this project.
    – Qorey
    Commented Jan 6, 2023 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.