payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
27.78k stars 1.73k forks source link

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

Open didierrothuizen opened 4 weeks ago

didierrothuizen commented 4 weeks ago

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

DanRibbens commented 4 weeks ago

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

didierrothuizen commented 1 week ago

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

didierrothuizen commented 3 days ago

@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?