octoper / statamic-html-minify

5 stars 4 forks source link

Forms gets saved twice #17

Open robbanl opened 1 year ago

robbanl commented 1 year ago

Description

When having this addon, forms are being saved twice.

Steps to reproduce

  1. Output form
  2. Submit form
  3. See how 2 entries are stored

Additional information

hlorofos commented 1 year ago

All methods (like custom APIs) are called twice, this is the critical issue.

jbrhel commented 1 year ago

@hlorofos, you can fix it by changing line 34 in HtmlMinifyMiddleware.php.

From this: return $next($request);

To this: return $response;

Since the response is already set on line 22, this change will prevent duplicated calls.