Support Forum » User Profile

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Issue with Post field type and "select_advanced" #44252
    SASSAS
    Participant

    Our issue was the we've checked in the filter callback if we're on the page in the WP backend where the metabox we've defined should be displayed or not.

    If not, we've returned the array we've received through the metabox filter hook as is, without adding our metabox and fields. The intention was to add our metabox and fields only on the settings pages where we need it.

    This works fine, but some field types like select_advanced doing some ajax calls to retrieve the selectable options, in our case back then because we've used the field without the options parameter, instead we used it to offer posts to select. In that case, metabox does an ajax call to retrieve and populate the select_advanced field options with the available posts. I assume the post_field does an ajax call as well and works similar.

    Since we kind of registered the metabox only on that specific settings page, the metabox and it's fields weren't defined when doing the ajax call.

    We've fixed it by removing our check if we're on the page on which we need the metabox.

    Here's an example which might help:

    private function __construct() {
      add_filter( 'mb_settings_pages', [ $this, 'settings_page'], 0, 1 );
      add_filter( 'rwmb_meta_boxes',   [ $this, 'settings'],      0, 1 );
    }
    
    public function settings_page( $settings_pages ) {
      // add our settings pages
      return $settings_pages
    }
    
    public function settings( $meta_boxes ) {
      /*
       * This broke it when having a field type which is doing ajax calls. Fields which aren't doing ajax calls are 
         not affected.
       */
      //=======================================
      if ( ! empty( $_GET['page'] ) ) {
        if ( 'my-settings-page' <> $_GET['page'] ) {
          return $meta_boxes;
        }
      }
      //=======================================
    
      $meta_boxes[]        = [
        'id'               => 'my_settings',
        'title'            => 'Login Settings',
        'settings_pages'   => 'my-settings-page',
        'tab'              => 'login_settings',
        'fields'           => [
           [
             'id'          => 'login_page_id',
             'name'        => _x( 'Login page', 'admin', 'demo' ),
             'desc'        => _x( 'Choose your default login page.', 'admin', 'demo' ),
             'type'        => 'post',
             'post_type'   => 'any',
             'field_type'  => 'select_advanced',
             'placeholder' => _x( 'Default WordPress login page', 'admin', 'demo' )
           ]
        ]
      ];
    
      return $meta_boxes;
    }

    Hope that helps!

    in reply to: Conflict with Blocks and Beaver Builder #32226
    SASSAS
    Participant

    Thanks for refering to another topic. Am i right that this issue is a known one for more than a year?

    in reply to: HTML in Buttongroups are not working #26860
    SASSAS
    Participant

    Hi,

    is there any update on this topic?!
    Because the topic ist marked as resolved. But the problem is still there.
    Still looks like this: https://imgur.com/kLIz1My
    Image does not work, please visit: https://imgur.com/kLIz1My

    in reply to: HTML in Buttongroups are not working #26859
    SASSAS
    Participant

    Hi there,

    is there any update on this topic?!

    in reply to: HTML in Buttongroups are not working #24830
    SASSAS
    Participant

    Thank you a lot 🙂

    in reply to: HTML in Buttongroups are not working #24824
    SASSAS
    Participant

    Image does not work please visit https://imgur.com/akxP6F1

    Example of how it looks like - http://imgur.com/akxP6F1

    in reply to: Issue with Post field type and "select_advanced" #18694
    SASSAS
    Participant

    Hi Ahn,

    we've figured it out.

    In our code we don't add our metabox code to your filter array on admin pages where it shouldn't be displayed.

    It seems like that your AJAX call triggers the filter execution and because we're not adding our code on admin-ajax.php it breaks somehow your ajax call.

    We've workaround it and all is working for us.

    Thanks for assistance, we're really appreciate your effort!

    in reply to: Issue with Post field type and "select_advanced" #18667
    SASSAS
    Participant

    Hi Ahn,

    Thank you for looking into this! I really appreciate it!

    I reinstalled Meta Box and cleared the browser cache. I also created a very new WP site, still no joy.
    The ajax call ends as a 400 (badrequest).

    I don't think it is a caching issue. It also is not a general ajax issue, since other ajax calls working as expected.

    I've checked with others in my team, they experiencing the same issue. In the select box it displays "The results couldn't be loaded", once i change the "field_type" from "select_advanced" to "select" all is working, but i've mentioned that earlier in our conversation.

    Not sure if this might help you to sort this out, but we're using this with your "settings page extension" implemented through.

    Please advise.

    Thank you!

    Best,
    John

    in reply to: (Repeatable?) Block over certain content length crashes #16663
    SASSAS
    Participant

    Hi Anh,

    unfortunately you can not sort the items in a repeatable group.
    And the Conditional Logic does not fit in the MB Blocks too.

    Any solutions for this?!

    in reply to: Some field types are not displayed within the block #15761
    SASSAS
    Participant

    Hi Anh,

    unfortunately, some fields are still not displayed correctly. E.g. "Images" and "Colors". Also, "Button Group" is not saved correctly. If I choose something and save the page, the selected button is still checked, but if I reload the page, the selected button is no longer selected.

    We use the latest version 1.0.4 and MB Blocks plugin individually.

    Can you help?

    in reply to: Field validation on settings page with tabs #13616
    SASSAS
    Participant

    Thanks for considering this as a future feature!

    In some projects, we have lots of tabs and hundreds of settings and it's not very convenient to click through all tabs to look for possible issues. It would be a great improvement.

    Besides this issue (at least for me), awesome work, awesome framework! Keep up the good work!

Viewing 11 posts - 1 through 11 (of 11 total)