Customizer "something went wrong" when advanced image is reset

Support MB Settings Page Customizer "something went wrong" when advanced image is reset

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39773
    Aaron KesslerAaron Kessler
    Participant

    The return value of add_filter('rwmb_meta_boxes', [$this, 'register_meta_boxes']) function is

    $fields[] = [
        'title' => __('Weitere Einstellungen', NAME_SPACE),
        'id' => PREFIX . 'theme-settings',
        'panel' => '',
        'fields' => [
            [
                'name' => __('E-Mail', NAME_SPACE),
                'id' => PREFIX . 'email',
                'type' => 'email',
                'label_description' => __('Die E-Mail-Adresse wird im Navigationsmenü und in der Fußzeile angezeigt.', NAME_SPACE),
            ],
            [
                'name' => __('Seiten-Hintergrund', NAME_SPACE),
                'id' => PREFIX . 'page_background',
                'type' => 'image_advanced',
                'max_file_uploads' => 1,
                'max_status' => false,
                'label_description' => __('Hintergrundbild für die Seite.', NAME_SPACE),
            ],
            [
                'name' => __('Menü-Hintergrund', NAME_SPACE),
                'id' => PREFIX . 'menu_background',
                'type' => 'image_advanced',
                'max_file_uploads' => 1,
                'max_status' => false,
                'label_description' => __('Hintergrundbild für das Menü-Overlay.', NAME_SPACE),
            ],
        ],
    ];

    when resetting the image in the customizer, the value of the get_theme_mod(PREFIX . 'page_background') becomes an empty string and the customizer states "something went wrong"

    How can I fix this?

    #39795
    PeterPeter
    Moderator

    Hello Aaron,

    Thanks for your feedback.

    I also see that issue on my demo site. If you publish the change and see the error message like "something went wrong", you can reload the customizer page and change other settings again. I will inform the development team to check this issue and fix it in the next update.

    #39796
    Aaron KesslerAaron Kessler
    Participant

    Thanks Peter, I did know about the workaround.
    I would appreciate it, if you update this thread when this is fixed. I like the idea of being subscribed per mail to issues I report.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.