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

Preview does not work with non-standard documents #1886

Closed
danrot opened this issue Dec 16, 2015 · 1 comment · Fixed by #1926
Closed

Preview does not work with non-standard documents #1886

danrot opened this issue Dec 16, 2015 · 1 comment · Fixed by #1926
Labels
Bug Error or unexpected behavior of already existing functionality
Milestone

Comments

@danrot
Copy link
Contributor

danrot commented Dec 16, 2015

The scenario described in http://stackoverflow.com/questions/34120232/sulu-extend-pagedocument?noredirect=1#comment56338102_34120232 doesn't work as intended, as the error in this thread explains.

Main point is when creating an own document class and using it with this configuration in app/config/config.yml:

sulu_document_manager:
    mapping:
        page:
            class: Client\Bundle\WebsiteBundle\Document\PageDocument
            phpcr_type: sulu:page

The preview does not work, it just shows the following exception:
image

After a fast research I could track that down to the deserialization part of the preview. When the class is serialized the document is of the right type (Client\Bundle\WebsiteBundle\Document\PageDocument), but after deserialization the type is again Sulu\Bundle\ContentBundle\Document\PageDocument.

@wachterjohannes
Copy link
Member

i have found the exact line of error: https://github.com/sulu-io/sulu/blob/develop/src/Sulu/Component/Content/Compat/Serializer/PageBridgeHandler.php#L94

here we should also store the name of class in the serialized content and use it here. i will create a pr to fix this issue

@danrot danrot added the Bug Error or unexpected behavior of already existing functionality label Jan 11, 2016
@danrot danrot added this to the Release 1.2 milestone Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error or unexpected behavior of already existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants