Forum Replies Created
-
AuthorPosts
-
August 8, 2023 at 12:10 AM in reply to: ✅500 server error when posting data containing non-existent fields #42834
danieldk
ParticipantDear Peter,
thanks for your reply. From reading the documentation I see that the Metabox REST API extension only takes care of its own fields. Which makes perfect sense.
However, what does not make sense is that it crashes when someone sends in a field that doesn't exist as a metabox field, or even doesn't exist as a custom field at all -- see my example.
I propose that there is better error handling in the REST controller from the Metabox Extension. I see two behaviors:
1. Ignore the field that doesn't exist, but don't crash.
2. Ignore the field and return an error message that says "syntax error. field XXX doesnt exist".August 7, 2023 at 12:52 AM in reply to: ✅500 server error when posting data containing non-existent fields #42824danieldk
ParticipantMy WordPress setup is:
WordPress Version: 6.2.2
Current WordPress Theme: Bootstrap4 Genesis version 1.3.0genesis
Theme Author: Sal Ferrarello - https://salferrarello.com
Theme URI: https://github.com/salcode/bootstrap4-genesis
PHP Version: 8.0.28
MySQL Version: 10.6.5-MariaDB-1:10.6.5+maria~focal
Apache Version: Apache/2.4.56 (Debian)Meta Box (5.7.4)
Meta Box AIO (1.21.4)
REST API Toolbox (1.4.3)danieldk
ParticipantHa! I am getting closer: looks like there is user meta data that was stored in my database about the location of metaboxes.
Is there a way to delete these settings using metabox AIO?
danieldk
ParticipantHere's my minimal definition of the relationship.
Moving the metabox into the main column works only on the FROM side, but not on the TO side.
Is that the intention, or a bug?add_action('mb_relationships_init', function () { MB_Relationships_API::register([ 'id' => 'djs_to_events', 'from' => array( 'post_type' => 'tmd_dj', 'meta_box' => array( 'context' => 'normal', ), ), 'to' => array( 'post_type' => 'tmd_event', 'meta_box' => array( 'context' => 'normal', ), ), ]); });danieldk
ParticipantThanks! That would be really great!
danieldk
ParticipantNevermind the error: I have found the mistake: I was registering a filter that didn't work.
Now I am all set: I can use mapbox as I like it!danieldk
ParticipantI have written this also on github: when I disable the metabox builder I get an error message referencing Line 48 in core.php -- which means I can only use metabox with the builder, but not without.
Maybe a php 7 issue?
danieldk
ParticipantAh, OK, I finally found the export: it's in the actions on the metabox listing. Unfortunately the resulting .dat-file contains a lot of binary, and cannot be used for easy changes.
Why I wanted to only prototype with the builder, and run it via php and filters:
* I have a few advanced selects where I am creating the options programmatically. I assume this is not possible with the builder interface?
* In my php I can re-use fields easily, and copy&paste between metaboxes. This is not so easy to do with the builder.
* In my php I can also fine tune options faster and see how it looks.So my ideal is: prototype with builder, export the php, and go from there.
-
AuthorPosts