Forum Replies Created
-
AuthorPosts
-
May 23, 2024 at 10:22 PM in reply to: WooCommerce High-Performance Order Storage (HPOS) Support and Compatibility #45510
Ben R
ParticipantHi, any update on this feature?
March 22, 2024 at 5:38 AM in reply to: โ mbct_before_update - want to identify if a field has changed #44963Ben R
ParticipantI see that there was an update to potentially work around this issue.
Add a $force param to API::get() method to force getting raw data from the database (true: default) or cache (false).
However, this update is now crashing custom tables (specifically a model I have created). When I try to add a new element to my model, I get the following:
[21-Mar-2024 22:35:29 UTC] PHP Fatal error: Uncaught TypeError: MetaBox\CustomTable\Cache::get(): Argument #1 ($object_id) must be of type int, string given, called in /bitnami/wordpress/wp-content/plugins/mb-custom-table/src/Storage.php on line 29 and defined in /bitnami/wordpress/wp-content/plugins/mb-custom-table/src/Cache.php:19 Stack trace: #0 /bitnami/wordpress/wp-content/plugins/mb-custom-table/src/Storage.php(29): MetaBox\CustomTable\Cache::get() #1 /bitnami/wordpress/wp-content/plugins/meta-box/inc/field.php(148): MetaBox\CustomTable\Storage->get() #2 /bitnami/wordpress/wp-content/plugins/meta-box/inc/field.php(535): RWMB_Field::raw_meta() #3 /bitnami/wordpress/wp-content/plugins/meta-box/inc/meta-box.php(328): RWMB_Field::call() #4 /bitnami/wordpress/wp-content/plugins/meta-box/inc/meta-box.php(192): RW_Meta_Box->is_saved() #5 /opt/bitnami/wordpress/wp-admin/includes/template.php(1456): RW_Meta_Box->show() #6 /bitnami/wordpress/wp-content/plugins/mb-custom-table/views/add.php(25): do_meta_boxes() #7 /bitnami/wordpress/wp-content/plugins/mb-custom-table/src/Model/Admin.php(209): include('...') #8 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(324): MetaBox\CustomTable\Model\Admin->render() #9 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #10 /opt/bitnami/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action() #11 /opt/bitnami/wordpress/wp-admin/admin.php(259): do_action() #12 {main} thrown in /bitnami/wordpress/wp-content/plugins/mb-custom-table/src/Cache.php on line 19March 15, 2024 at 12:15 AM in reply to: MB_Relationships_API::each_connected not working, need fix or alternative #44864Ben R
ParticipantIs there any update on this? I, too, could not get each_connected working and switched to get_connected, but we need a solution with a single query for performance reasons. (The documentation refers to each_connected but if this isn't accurate, it should be updated.)
March 14, 2024 at 10:05 PM in reply to: โ mbct_before_update - want to identify if a field has changed #44860Ben R
ParticipantThanks much, I appreciate it. I'll use this workaround for now.
By the way, I love your plugin. It's fantastic.
March 14, 2024 at 12:15 AM in reply to: โ mbct_before_update - want to identify if a field has changed #44851Ben R
ParticipantThanks for your help. However, the very nature of this hook is to access the record before it has been updated, so I would expect to be able to accomplish that in an elegant fashion.
I do appreciate the caching - don't get me wrong! But hitting raw sql here seems like a hack to me.
March 13, 2024 at 11:49 PM in reply to: Custom tables with revisions enabled - mbct_before_add fires for the revision #44850Ben R
ParticipantYes, I understand that a revision creates a new post, but the original id should be added to the hook parameters. (I feel like relying on the POST data is a hack.) I think you should consider not firing that at all under this particular circumstance. Consider the nature of the mbct_before_add hook and why it exists: developers are trying to understand when a new custom table record is being added, not when a revision is created.
At the very least, please document this circumstance where it gets fired incorrectly when revisions are enabled, because this could have unintended consequences for anyone using it.
-
AuthorPosts