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 Creation of a Page From a Blank Template #3584

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

adrians5j
Copy link
Member

@adrians5j adrians5j commented Oct 9, 2023

Changes

This PR updates the default value of the content field of a page template:

const getDefaultContent = () => {
    return {
        id: uniqid.time(),
        type: "document",
        data: {
            // ℹ️ Added `template.variables` array here.
            template: {
                variables: []
            }
        },
        elements: []
    };
};

Without this, the template content resolution happening in the content GraphQL field would fail, because the process is expecting the template.variables array to be present.

How Has This Been Tested?

Manually.

Documentation

Changelog.

@adrians5j adrians5j added this to the 5.38.0 milestone Oct 9, 2023
@adrians5j adrians5j merged commit 80ec707 into next Oct 9, 2023
58 checks passed
@adrians5j adrians5j deleted the adrian/create-page-from-tpl-fix branch November 20, 2023 08:51
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