Own field types doesn't works on MB builder 5

Support MB Builder Own field types doesn't works on MB builder 5

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #48930
    KevinKevin
    Participant

    Hi,

    I have a many own custom fields created for my needs, but with MB builder update, all of them won't work anymore.
    I started with a fresh installation, update and try to create a simple display :

    class RWMB_kevin_Field extends RWMB_Field {
        public static function html( $meta, $field ) {
            return '<div class="alert alert-info">Hello Kevin !</div>';
        }
    }

    I then add it to MB builder with usual code :

    add_filter( 'mbb_field_types', function ( $field_types ) {
        $field_types['kevin'] = [
            'title'    => __( 'Kevin', 'your-text-domain' ),
            'category' => 'layout',
            'controls' => [
                'name', 'id', 'type', 'label_description', 'desc',
                'clone', 'sort_clone', 'clone_default', 'clone_as_multiple', 'max_clone', 'add_button',
                'before', 'after', 'class', 'save_field', 'sanitize_callback', 'attributes', 'custom_settings',
            ],
        ];
    
        return $field_types;
    } );

    It shows up in the new MB Builder interface, but, when i want to add it to my form it, i get the following error :

    react-dom.min.js?ver=18.3.1.1:10 Error: Cannot find module './Kevin'
        at app.js?ver=a8011bf…:1:128093

    It used to works fine before the update, and it do it with every own custom fields type in the builder. OCF works fine with PHP extract and in backend/MB frontend submission.

    Thanks for your help,
    K

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.