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

Fix EZP-30957: avoid exceptions on content types not in the generated schema #55

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

bdunogier
Copy link
Member

@bdunogier bdunogier commented Sep 20, 2019

After a content type has been added, but before the schema has been generated, trying to list
a location's sub-items that contain one of those items will error out. The typeResolver of the
DomainContent interface will return for items of those types a name that doesn't exist in the schema.

To work around that, content items of types that don't exist in the schema are mapped to an "anonymous" type, "UntypedContent". It has the properties shared by all content items (_url, _name, thumb etc, but not the fields.

TODO

  • Consider renaming the type. AnonymousContent (done, to UntypedContent)?
  • Rebase against the 1.x branch as it is also affected

@mnocon
Copy link
Member

mnocon commented Sep 23, 2019

@bdunogier this PR no longer fixes the issue (it worked correctly before the name change), could it be because UngeneratedContent is still mentioned in the code?

@bdunogier
Copy link
Member Author

could it be because UngeneratedContent is still mentioned in the code?

Yes, probably. I'll fix it right away.

… schema

After a content type has been added, but before the schema has been generated, trying to list
a location's sub-items that contain one of those items will error out. The typeResolver of the
DomainContent interface will return for items of those types a name that doesn't exist in the schema.

To work around that, content items of types that don't exist in the schema are mapped to an "anonymous" type,
"UntypedContent".
@bdunogier bdunogier force-pushed the ezp30957-ungenerated_types branch from f077a1e to 7db96bb Compare September 23, 2019 10:28
@bdunogier bdunogier changed the base branch from master to 1.0 September 23, 2019 10:28
@bdunogier
Copy link
Member Author

It should be fixed now @mnocon.

Copy link
Member

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (and fixes the issue after I've rebased this PR to master).

IMHO we should merge this to unblock Travis, what do you think?

@lserwatka lserwatka merged commit c0533eb into 1.0 Sep 23, 2019
@lserwatka
Copy link
Member

@bdunogier could you merge it up?

@lserwatka lserwatka deleted the ezp30957-ungenerated_types branch September 23, 2019 11:15
@mnocon
Copy link
Member

mnocon commented Sep 23, 2019

Merged to master in 46a4032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants