Support Forum » User Profile

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: Access previous versions of Meta Box AIO via Composer #46227
    MaxMMaxM
    Participant

    Same here, i upgraded from 1.16.5 to 1.30, but had some sort of bug in sortable elements, or group elements.
    QM show this error:

    Undefined array key "clone_empty_start"	
    wp-content/plugins/wp-dd-metabox-aio/vendor/meta-box/meta-box-aio/vendor/meta-box/meta-box-group/group-field.php:219

    I have some sortable elements into group and after updating meta-box-aio appear an "Element 0" in existing elements, and if i delete this element 0 after saving element 0 appear again.

    So i need to revert MBAIO to previous version and i have to be able to do it in composer.
    Best practice is to have version number into composer and not dev-master ....so everyone can handle versions.. i don't understand why i so difficult replate dev-master with version number...

    MaxMMaxM
    Participant

    Resolved.

    One plugin has wrong metabox definition fields.

    Wrong

    add_filter( 'rwmb_meta_boxes', function(){
    $myfields[] = [definitions]
    return $myfields
    }, 10);

    Instead of correct definition

    add_filter( 'rwmb_meta_boxes', function($meta_boxes){
    $meta_boxes[] = [definitions]
    return $meta_boxes
    }, 10);
    in reply to: Tabs dissapeared after update to wp 5.9 #33767
    MaxMMaxM
    Participant

    Resolved, i don't know why but on new fresh install all working as expected.

    in reply to: Metabox within a plugin #33743
    MaxMMaxM
    Participant

    see pastbin https://pastebin.com/CGd7p9LH

    in reply to: Metabox within a plugin #33742
    MaxMMaxM
    Participant

    I had similar settings trouble. I resolved with putting into every tab one switch element and when swith element is on i show a group of fields.

    Another possible solution would be (i haven't tried).
    Into first tab add swithes elements one for every tab.
    Then add a field of actived tabs only if switch in on.

    $main_config = [
    'title' => __( 'Main Page', 'igm-reviews' ),
    'id' => 'main-page',
    'tab_style' => 'box',
    'tab_default_active' => 'tab_main',
    'tabs' => [
    'tab_main' => [
    'label' => 'Activate TABS',
    'icon' => 'admin-home',
    ],
    'tab_1' => [
    'label' => 'TAB 1',
    'icon' => '',
    ],
    'tab_2' => [
    'label' => 'TAB 2',
    'icon' => '',
    ]
    ],
    'fields' => [
    [
    'tab' => 'tab_main',
    'name' => __( 'Activate Tab 1?', 'textdomain' ),
    'id' => 'tab_1',
    'type' => 'post',
    'field_type' => 'switch',
    ],
    [

    'tab' => 'tab_main',
    'name' => __( 'Activate Tab 2?', 'textdomain' ),
    'id' => 'tab_2',
    'type' => 'post',
    'field_type' => 'switch',
    

    ],

    ];]

    // Then after saving tabs you check if switch are activated and add configuration array to main array

    $tab_1 = [
    'tab' => 'tab_1',
    'name' => __( 'Input Title', 'textdomain' ),
    'id' => 'title,
    'type' => 'post',
    'field_type' => 'text',
    ],

    $tab_2 = [

    'tab' => 'tab_2',
    'name' => __( 'Input Name', 'textdomain' ),
    'id' => 'name,
    'type' => 'post',
    'field_type' => 'text',
    ],

    if( switch(tab_1) == on )
    //then add to main array

    $main_array['fields][] = $tab_1

    return $main_array

    Code isen't tested. only for example.

    MaxMMaxM
    Participant

    I resolved. I removed TGMPA from metabox-AIO with this steps:

    Remove action add_action( 'tgmpa_register', [$this, 'require_plugins'] );
    inside MBAIO\Plugin

    with this function

    function remove_hook_for_anonymous_class(
        $hook_name = '',
        $class_name = '',
        $method_name = '',
        $priority = 10
    ) {
        global $wp_filter;
    
        // Take only filters on right hook name and priority
        if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) ||
             ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) {
            return false;
        }
    
        foreach ( (array) $wp_filter[ $hook_name ][ $priority ] as $unique_id => $filter_array ) {
            if ( isset( $filter_array['function'] ) && is_array( $filter_array['function'] ) ) {
                if ( is_object( $filter_array['function'][0] ) &&
                     get_class( $filter_array['function'][0] ) &&
                     get_class( $filter_array['function'][0] ) == $class_name &&
                     $filter_array['function'][1] == $method_name ) {
                    if ( is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
                        unset( $wp_filter[ $hook_name ]->callbacks[ $priority ][ $unique_id ] );
                    } else {
                        unset( $wp_filter[ $hook_name ][ $priority ][ $unique_id ] );
                    }
                }
            }
        }
        return false;
    }

    Then i call remove_hook_for_anonymous_class

    in main plugin file:

    remove_hook_for_anonymous_class( 'tgmpa_register', 'MBAIO\Plugin', 'require_plugins' );
    
    MaxMMaxM
    Participant

    Same problem here, i use composer without bedrock but when activate plugin i get notice that meta-box is required, but it is installed trought composer
    here my composer.json

    {
      "repositories":[
        {
          "type": "composer",
          "url": "https://wpackagist.org"
        },
        {
          "type": "composer",
          "url": "https://packages.metabox.io/KEY"
        }
      ],
      "require": {
        "wpackagist-plugin/meta-box":"^5",
        "meta-box/meta-box-aio": "dev-master",
        "composer/installers": "^1",
        "yahnis-elsts/plugin-update-checker": "^4"
      },
      "extra": {
        "installer-paths": {
          "vendor/meta-box/meta-box": ["wpackagist-plugin/meta-box"],
          "vendor/meta-box/{$name}/": ["type:wordpress-plugin"]
        }
      },
      "autoload": {
        "files": [
          "vendor/meta-box/meta-box/meta-box.php",
          "vendor/meta-box/meta-box-aio/meta-box-aio.php"
        ]
      }
    }
    
    in reply to: Composer install error #24762
    MaxMMaxM
    Participant

    Found mistake.

    Replace this line : "wpackagist-plugin/meta-box": "dev-trunk",

    with: "wpackagist-plugin/meta-box": "^5",

    please update composer.json that i found here:

    https://github.com/wpmetabox/library/blob/master/composer/composer.json

    Thanks

    in reply to: Composer install error #24761
    MaxMMaxM
    Participant

    i just update my composer.json with

    {
      "repositories":[
        {
          "type": "composer",
          "url": "https://wpackagist.org"
        },
        {
          "type": "composer",
          "url": "https://packages.metabox.io/xxxxx"
        }
      ],
      "require": {
        "wpackagist-plugin/meta-box": "dev-trunk",
        "meta-box/meta-box-aio": "dev-master",
        "composer/installers": "^1"
      },
      "extra": {
        "installer-paths": {
          "vendor/meta-box/meta-box": ["wpackagist-plugin/meta-box"],
          "vendor/meta-box/{$name}/": ["type:wordpress-plugin"]
        }
      },
      "autoload": {
        "files": [
          "vendor/meta-box/meta-box/meta-box.php",
          "vendor/meta-box/meta-box-aio/meta-box-aio.php"
        ]
      }
    }
    

    But nothing change, i get the same error:

    
    Package operations: 3 installs, 0 updates, 0 removals
      - Installing composer/installers (v1.10.0): Extracting archive
      - Installing meta-box/meta-box-aio (master): Extracting archive
      - Installing wpackagist-plugin/meta-box (dev-trunk):  Checking out trunk
        Install of wpackagist-plugin/meta-box failed
     1/1 [============================] 100%
                                                            
      [RuntimeException]                                    
      wpackagist-plugin/meta-box could not be downloaded,   
      sh: 1: svn: not found                                 
                                                            
    
Viewing 9 posts - 1 through 9 (of 9 total)