Skip Navigation

[Resolved] Fatal error caused by CRED in combination with Enhanced Media Library plugin

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 8 months ago.

Assisted by: Nigel.

Author
Posts
#2696629

I’m getting the following fatal error with the most current versions of WordPress, CRED and Enhanced Media Library:

[08-May-2024 14:02:15 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function wpuxss_eml_upload_mimes(), 1 passed in /home/xxxxxxx/public_html/wp-includes/class-wp-hook.php on line 324 and exactly 2 expected in /home/xxxxxxx/public_html/wp-content/plugins/enhanced-media-library/core/mime-types.php:157
Stack trace:
0 /home/xxxxxxx/public_html/wp-includes/class-wp-hook.php(324): wpuxss_eml_upload_mimes(Array)
1 /home/xxxxxxx/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
2 /home/xxxxxxx/public_html/wp-content/plugins/cred-frontend-editor/application/models/form/base.php(363): apply_filters('upload_mimes', Array) 
3 /home/xxxxxxx/public_html/wp-content/plugins/cred-frontend-editor/application/controllers/form_builder_base.php(42): CRED_Form_Base->print_form() 
4 /home/xxxxxxx/public_html/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/CRED_Helper.php(2116): CRED_Form_Builder_Base->get_form(1479, 5773) 
5 /home/xxxxxxx/public_html/wp-includes/class-wp-hook.php( in /home/xxxxxxx/public_html/wp-content/plugins/enhanced-media-library/core/mime-types.php on line 157

According to the developers of Enhanced Media Library, this is caused by CRED:

https://wordpress.org/support/topic/fatal-error-in-v2-8-14/#post-17742127

#2696696

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Martin

I can see the problem in our code and I have shared it with the developers to request a fix.

The necessary change is actually very simple, if you want to make it yourself (editing our plugin code).

Edit the file wp-content/plugins/cred-frontend-editor/application/models/form/base.php

You should find this as line 363:

CRED_StaticClass::$_allowed_mime_types = apply_filters( 'upload_mimes', CRED_StaticClass::$_allowed_mime_types );

You can change it to add an additional argument, null, like so:

CRED_StaticClass::$_allowed_mime_types = apply_filters( 'upload_mimes', CRED_StaticClass::$_allowed_mime_types, null );

It is a trivial change, so I expect our developers should adopt it in time for the next Forms update.

#2697305

Hi Nigel

Thank you for your explanation. I am looking forward to the next version of your plugin.

Best,
Martin