skydiver / october-plugin-forms

Create easy (and almost magic) AJAX forms
https://octobercms.com/plugin/martin-forms
MIT License
60 stars 41 forks source link

Plugin breaks in Build >1.0.469 #213

Closed LukeTowers closed 4 years ago

LukeTowers commented 4 years ago

Because this plugin abuses an unsupported bug in older October builds (loading JS files as partials) that was blocked for security reasons in Build v1.0.469 and onwards (and never should have been present in the first place) this plugin breaks on newer builds of October. See https://github.com/octobercms/october/issues/5272.

The problematic code is here: https://github.com/skydiver/october-plugin-forms/blob/f3fe2feca89712a7be2c4758c4e5c12d39c0369b/classes/MagicForm.php#L278-L283

PubliAlex commented 4 years ago

Is there a quick and dirty fix ? cause I have some production website that are stuck because of this actually...

LukeTowers commented 4 years ago

@PubliAlex very very dirty quick fix is the following, DO NOT KEEP AROUND IN PRODUCTION, THIS CODE IS NOT GUARANTEED TO CONTINUE WORKING:

\Cms\Classes\Partial::extend(function($model) {
   $model['allowedExtensions'] = ['htm', 'js'];
});
skydiver commented 4 years ago

Thanks for the help, this will be released on v1.5.0 https://github.com/skydiver/october-plugin-forms/pull/216

Kusdrae commented 3 years ago

is there any real solution to this problem ? i cannot resolve it in my project

LukeTowers commented 3 years ago

@Kusdrae you should just be able to update the plugin.