Forum Replies Created
-
AuthorPosts
-
Jai Ivarsson
ParticipantOk, 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.Jai Ivarsson
ParticipantI 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: yesI 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
Jai Ivarsson
ParticipantThanks Peter. I have been suspecting load order as the cause but can't see how to fix it...
Jai Ivarsson
ParticipantFor 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.
Jai Ivarsson
ParticipantI've been looking at this a bit closer. The top group row of data is being given the class of
rwmb-clone-templatewhich 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.
Jai Ivarsson
ParticipantHi 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?Jai Ivarsson
ParticipantI 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?Jai Ivarsson
ParticipantI've just discovered this bug too after updating my composer dependences.
Is there somewhere we can track the ticket apart from this post?Jai Ivarsson
ParticipantHi, 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.
Jai Ivarsson
ParticipantThanks 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.
Jai Ivarsson
ParticipantThanks 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.
Jai Ivarsson
ParticipantThank you Peter!
Makes perfect sense once I saw it.
-
AuthorPosts