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 for form-builder bug not yet published to npm #8849

Open
didierrothuizen opened this issue Oct 24, 2024 · 1 comment
Open

Fix for form-builder bug not yet published to npm #8849

didierrothuizen opened this issue Oct 24, 2024 · 1 comment
Assignees
Labels
status: verified If an issue has been reproduced v2

Comments

@didierrothuizen
Copy link

didierrothuizen commented Oct 24, 2024

Link to reproduction

No response

Describe the Bug

About half a year ago, there was a fix for the form builder that correctly extended all hook overrides that are applied to the formSubmissions collection. See this commit
Unfortunately, this fix has never been published to npm.

Can someone release and publish a version 1.2.3? (in package.json)

To Reproduce

Install latest version of the form builder plugin
Inspect files in the node_modules folder
note that in node_modules/@payloadcms/plugin-form-builder/dist/collections/FormSubmissions/index.js the file mismatches with how the source code is.

The code in the installed index.js:

        hooks: {
            beforeChange: [
                (data)=>(0, _createCharge.default)(data, formConfig),
                (data)=>(0, _sendEmail.default)(data, formConfig),
                ...formConfig?.formSubmissionOverrides?.hooks?.beforeChange || []
            ],
            ...formConfig?.formSubmissionOverrides?.hooks || {}
        }

The source code:

    hooks: {
      ...(formConfig?.formSubmissionOverrides?.hooks || {}),
      beforeChange: [
        (data) => createCharge(data, formConfig),
        (data) => sendEmail(data, formConfig),
        ...(formConfig?.formSubmissionOverrides?.hooks?.beforeChange || []),
      ],
    },

Payload Version

2.30.3

Adapters and Plugins

form-builder

@didierrothuizen didierrothuizen added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Oct 24, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 24, 2024
@DanRibbens
Copy link
Contributor

Thanks for bringing this to our attention! We'll make sure it is published.

@DanRibbens DanRibbens added the status: verified If an issue has been reproduced label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: verified If an issue has been reproduced v2
Projects
None yet
Development

No branches or pull requests

3 participants