Skip to content

Content without categorization behavior causes errors in view on multilingual sites #7309

@wesleybl

Description

@wesleybl

Describe the bug
Error occurred:

Cannot read properties of undefined (reading 'token')

To Reproduce
Steps to reproduce the behavior:

  1. Create a multilingual website.
  2. Create a content type without the plone.dublincore behavior.
  3. Add plone.translatable behavior to content.
  4. Create an object of that type.
  5. Set the language on the object (In my case this is done at installation):
obj.language = 'en'
  1. Access the view.

PS: It might be easier to simulate by removing the Document type plone.dublincore behavior.

Expected behavior
It should show the content type view without error.

Software (please complete the following information):

  • Volto Version 18.25.0
  • Plone Version 6.1.2

Additional context
This error started occurring after: #7125
I believe the line with the problem is:

{ '@id': content['@id'], language: content.language.token },

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions