Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sitecore-jss] Bugfix to prevent error: Cannot use ‘in’ operator to search for ‘editable’ in '' #1767

Closed
wants to merge 1 commit into from

Conversation

RobertoArmas
Copy link

@RobertoArmas RobertoArmas commented Apr 1, 2024

Description / Motivation

When working with page templates, designs, and instances within our DXP, it's essential to ensure smooth functionality and error-free operation. One recurring issue that has been identified is the error message "Cannot use the 'in' operator to search for 'editable' in [SOME-GUIDS]." This error occurs in a specific sequence of actions, including creating page templates, designs, instances, and overriding designs in the content editor.

The steps to reproduce the issue are straightforward: first, a page template is created, followed by the design of the page. Then, an instance of the page is generated, and its design is overridden from the dropdown in the content editor. Lastly, a page is selected from a multilist, which has had its design overridden. It's at this point that the error message appears.

Upon further investigation, it has been observed that the structure of Partial Designs does not align with the expected format. Instead of the {value, editable} structure, the Partial Designs exhibit a different format, which could potentially lead to the encountered error.

This approach delegates the decision to exclude "Page Designs" from traverseField to you, the expert in charge. By evaluating the impact and relevance of excluding this element, you can determine whether it aligns with jss requirements and objectives. This decision-making process ensures that we implement solutions that not only resolve the immediate issue but also uphold the integrity and functionality of Sitecore.

Testing Details

To reproduce the issue "Cannot use the 'in' operator to search for 'editable' in [SOME PARTIAL DESIGNS IDs]," follow these steps:

  • Create a Page Template.
  • Create a Page Design.
  • Create an Instance of a page.
  • Override the Page Design from the Dropdown in the Content Editor.
  • From a multilist, select the page which has the Page Design overwritten.

Upon completing these steps, you may encounter the error message. This issue could be due to the structure of Partial Designs, which should ideally follow the {value, editable} structure instead of the provided structure:

{
  "fields": {
    "PartialDesigns": "[SOME PARTIAL DESIGNS IDs]""
  }
}

The solution is to validate if field is type of string then were are on this scenario.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

To reproduce the issue "Cannot use the 'in' operator to search for 'editable' in [SOME-GUIDS]," follow these steps:

* Create a Page Template.
* Create a Page Design.
* Create an Instance of a page.
* Override the Page Design from the Dropdown in the Content Editor.
* From a multilist, select the page which has the Page Design overwritten.

Upon completing these steps, you may encounter the error message. This issue could be due to the structure of Partial Designs, which should ideally follow the {value, editable} structure instead of the provided structure:
{
  "fields": {
    "PartialDesigns": "SOME GUIDS"}"
  }
}

The solution is to validate if field is type of string then were are on this scenario.
@RobertoArmas RobertoArmas changed the title Fix: prevent Cannot use ‘in’ operator to search for ‘editable’ in [sitecore-jss] Bugfix to prevent error: Cannot use ‘in’ operator to search for ‘editable’ in '' Apr 1, 2024
@RobertoArmas RobertoArmas deleted the patch-1 branch April 1, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant