Support Forum ยป User Profile

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • in reply to: Custom fields not showing #48537
    Jai IvarssonJai Ivarsson
    Participant

    Ok, leaving this last comment, even though it shows how dumb I was and how long it took be to find it ๐Ÿ™

    When defining the fields, on a couple of taxonomy custom fields I was doing this:

    public function suburb_fields($meta_boxes)
        {
            $meta_boxes = [
                'title'      => 'Suburb Taxonomy Fields',
                'id'         => $this->text_domain . '-sd-suburb-fields',
                'taxonomies' => ['sd-suburb'],
                'fields'     => [
                    [
                        'name'       => __('City', $this->text_domain),
                        'id'         => $this->prefix . 'city',
                        'type'       => 'taxonomy',
                        'taxonomy'   => ['sd-city'],
                        'field_type' => 'select_advanced',
                        'add_new'        => false,
                        'remove_default' => false,
                    ],
                ]
            ];
    
            return $meta_boxes;
        }

    Instead of this:

    public function suburb_fields($meta_boxes)
        {
            $meta_boxes[] = [
                'title'      => 'Suburb Taxonomy Fields',
                'id'         => $this->text_domain . '-sd-suburb-fields',
                'taxonomies' => ['sd-suburb'],
                'fields'     => [
                    [
                        'name'       => __('City', $this->text_domain),
                        'id'         => $this->prefix . 'city',
                        'type'       => 'taxonomy',
                        'taxonomy'   => ['sd-city'],
                        'field_type' => 'select_advanced',
                        'add_new'        => false,
                        'remove_default' => false,
                    ],
                ]
            ];
    
            return $meta_boxes;
        }

    Note the $meta_boxes = ... instead of $meta_boxes[] = ...
    This stupid mistake on two taxonomy definitions was breaking everything, settings screens, custom post fields and of course taxonomy fields.

    in reply to: Custom fields not showing #48521
    Jai IvarssonJai Ivarsson
    Participant

    I tried loading the fields in the functions.php and it worked.
    I added some debugging to try and understand what is happening.

    this in the plugin class that registers the post type and fields:

            error_log('Admin Init - MetaBox Debug:');
            error_log('RWMB_VER: ' . (defined('RWMB_VER') ? RWMB_VER : 'not defined'));
            error_log('MetaBox Class exists: ' . (class_exists('RWMB_Core') ? 'yes' : 'no'));
    

    All comes back as expected in the logs:
    Admin Init - MetaBox Debug:
    RWMB_VER: 5.10.10
    MetaBox Class exists: yes

    I added this after the registration of everything and confirmed that nothing is being registered:

    
    $meta_box_registry = rwmb_get_registry('meta_box');
    $field_registry = rwmb_get_registry('field');
    var_dump($meta_box_registry->all());
    var_dump($field_registry);
    

    both dumps being empty

    in reply to: Custom fields not showing #48520
    Jai IvarssonJai Ivarsson
    Participant

    Thanks Peter. I have been suspecting load order as the cause but can't see how to fix it...

    in reply to: โœ…Can I add taxonomy columns? #48301
    Jai IvarssonJai Ivarsson
    Participant

    For anyone who is having troubles with this like I was. Note that for Taxonomies, it isn't title but name. So if you are wanting your column to be before and after the first Name column it need to be set at "before name" or "after name" and not title like the defaults can be in documentation.

    in reply to: Problem with saving #47123
    Jai IvarssonJai Ivarsson
    Participant

    I've been looking at this a bit closer. The top group row of data is being given the class of rwmb-clone-template which means it is being hidden. So looks like it has disappeared. This is rendered server side and has nothing to do with the JS files.

    This group is submitted as the first in the group array since the fields in the group are legitimately form fields. But the server side code receiving it must be dropping this first group since it is expecting it to be a blank cloneable group and not a real value.

    I've checked what is saved and confirmed that it is being dropped before persisting to the database.

    I tried to follow the PHP to see where the $_POST object is being processed but seems to be quite a bit of coupling between the group module and the main meta box clone file that I couldn't find what I would looking for.

    in reply to: Problem with saving #47122
    Jai IvarssonJai Ivarsson
    Participant

    Hi Tan. Thanks for the extra gist. Unfortunately replacing the clone.js file didn't fix it either.

    I have two custom plugins using Meta Box with this project but only one with the Group feature. I discovered the clone.js file was loading from the other plugin and so updated that one too but the problem persists.

    Unfortunately, I don't have this on a server yet as I'm still finishing it up in local dev.


    @Hazmi
    Did you change both the group.js and clone.js files?

    in reply to: Problem with saving #47111
    Jai IvarssonJai Ivarsson
    Participant

    I have just tried dropping in that JS file into my vendor/meta-box/meta-box-group/group.js file and it doesn't fix the issue.
    I have a major deadline that I can't hit right now because I can't specify an earlier version of the extension in my composer.json file. When is this fix getting pushed through?

    in reply to: Problem with saving #46992
    Jai IvarssonJai Ivarsson
    Participant

    I've just discovered this bug too after updating my composer dependences.
    Is there somewhere we can track the ticket apart from this post?

    in reply to: โœ…Composer for premium extension not working #45264
    Jai IvarssonJai Ivarsson
    Participant

    Hi, I managed to fix this and thought I'd put the answer here for anyone else that comes across it.

    Short answer is found on this page https://github.com/composer/composer/issues/11913

    Seems that something with the a curl version installed on my Mac. Updating curl fixed it. Doesn't seem to have been the fix for everyone.

    In particular this problem only happened when trying to download and install the premium extensions.

    in reply to: โœ…Composer for premium extension not working #45225
    Jai IvarssonJai Ivarsson
    Participant

    Thanks Peter.

    This curl error is returned running composer in my local dev environment. There isn't hosting involved.

    To clarify, I'm running the composer command from my local terminal and getting that error.

    in reply to: โœ…Composer for premium extension not working #45213
    Jai IvarssonJai Ivarsson
    Participant

    Thanks for your reply Peter.

    The key definitely is fine as I have it working on multiple sites. But to make sure I generated a new one and tried that and got the same error.

    in reply to: โœ…Can't get an relation or to work in meta_query #43595
    Jai IvarssonJai Ivarsson
    Participant

    Thank you Peter!

    Makes perfect sense once I saw it.

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