payload icon indicating copy to clipboard operation
payload copied to clipboard

Fix for form-builder bug not yet published to npm

Open didierrothuizen opened this issue 1 year ago • 3 comments

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 avatar Oct 24 '24 08:10 didierrothuizen

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

DanRibbens avatar Oct 24 '24 12:10 DanRibbens

@denolfe @DanRibbens What is the expected date that a new release will be published?

didierrothuizen avatar Nov 12 '24 10:11 didierrothuizen

@denolfe @DanRibbens This issue is blocking a major release for me. Can you please give an estimate of how long this will take to be resolved? Alternatively, could you propose a solution such that I can work with the fix in my project without publishing a release?

didierrothuizen avatar Nov 19 '24 10:11 didierrothuizen

Hey @didierrothuizen , thank you for your patience on this. v1.2.3 of plugin-form-builder was just published. You can also use the payload-2 tag.

denolfe avatar Dec 03 '24 13:12 denolfe

Awesome, glad to hear it 😄 Thanks for the help

didierrothuizen avatar Dec 03 '24 14:12 didierrothuizen

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Dec 05 '24 04:12 github-actions[bot]