Backup & Restore not working with Composer loading
Support › MB Settings Page › Backup & Restore not working with Composer loadingResolved
- This topic has 8 replies, 3 voices, and was last updated 4 years, 11 months ago by
Joe Anderson.
-
AuthorPosts
-
May 7, 2020 at 9:42 PM #19510
Joe Anderson
ParticipantI'm using loading meta box and all extensions through composer for my plugin. I am currently trying to setup the Backup & Restore field type but it doesn't seem to work when using composer. I tested this feature by installing/activating the all in one plugin, enabling the Settings extension and then the textarea seemed to show up correctly... Though, it still didn't contain json of my saved settings. Is this feature fully functional yet?
Thanks!
May 8, 2020 at 12:24 PM #19525Long Nguyen
ModeratorHi Joe,
Could you please share the code to create the Settings page and Backup & Restore field type? I will take a closer look and check it on my end.
May 8, 2020 at 9:27 PM #19530Joe Anderson
ParticipantFor sure. The code is below. I have removed other tabs for simplicity. Thanks for the help!
/** * Register settings pages * * @since 3.0 * @access public * @var array $settings_pages */ function ditty_settings_pages() { $settings_pages[] = array( 'id' => 'ditty_settings', 'option_name' => 'ditty_settings', 'menu_title' => __( 'Settings', 'ditty-news-ticker' ), 'capability' => 'manage_ditty_settings', 'parent' => 'edit.php?post_type=ditty_ticker', 'style' => 'no-boxes', 'columns' => 2, 'tabs' => array( 'backup' => __( 'Backup & Restore', 'ditty-news-ticker' ), ), ); return $settings_pages; } add_filter( 'mb_settings_pages', 'ditty_settings_pages' ); /** * Register settings metaboxes * * @since 3.0 * @access public * @var array $meta_boxes */ function ditty_settings_metaboxes( $meta_boxes ) { $meta_boxes[] = array( 'id' => 'backup', 'title' => __( 'Backup & Restore', 'ditty-news-ticker' ), 'settings_pages' => 'ditty_settings', 'tab' => 'backup', 'fields' => array( array( 'name' => __( 'Backup & Restore', 'ditty-news-ticker' ), 'type' => 'backup', ), ), ); return $meta_boxes; } add_filter( 'rwmb_meta_boxes', 'ditty_settings_metaboxes' );
May 9, 2020 at 9:51 AM #19538Long Nguyen
ModeratorHi,
I'm using the sample code from the documentation
'fields' => array( array( 'name' => 'Logo', 'id' => 'logo', 'type' => 'file_input', ), array( 'name' => 'Layout', 'id' => 'layout', 'type' => 'image_select', 'options' => array( 'sidebar-left' => 'https://i.imgur.com/Y2sxQ2R.png', 'sidebar-right' => 'https://i.imgur.com/h7ONxhz.png', 'no-sidebar' => 'https://i.imgur.com/m7oQKvk.png', ), ), array( 'name' => __( 'Backup & Restore', 'ditty-news-ticker' ), 'type' => 'backup', ), ),
and the field type
backup
works as well, see my screen record https://cl.ly/303ff96d3190.Could you please try to clear the cache and check this field again?
May 9, 2020 at 8:14 PM #19541Joe Anderson
ParticipantAre you loading metabox and the settings extension through composer? I am able to get it working when loading metabox through the standalone plugins or the AIO plugin. But, when I switch to just using composer (with latest available files) it still doesn't work. See screenshots.
May 11, 2020 at 9:19 AM #19552Anh Tran
KeymasterHi Joe,
I've just set up a simple test plugin with nothing than just Meta Box + MB Settings Page and I see the backup & restore field works properly. Please see my video for details:
May 11, 2020 at 8:56 PM #19561Joe Anderson
ParticipantThanks for looking into this. I'm not seeing any difference between my setup and what you are showing, but it still doesn't seem to work. Can you take a look at my video and let me know if you see anything wrong with my process? (I have a license code, but cleared it out for the video)
https://www.loom.com/share/d6ee367f782f4d259137643177156b49
Thanks!
May 12, 2020 at 10:55 AM #19579Anh Tran
KeymasterStrange, I see it's similar to my setup. I can think only about the downloaded version via Composer. Can you check the files in the vendor folder to see if they're the same as in the individual plugin?
May 13, 2020 at 7:50 AM #19587Joe Anderson
ParticipantIt seems my composer package was loading version 1.3.4 of the settings page, as opposed to version 2.1.0 of the single plugin... I'm not sure why.
I had run composer update, but for some reason the packages weren't updating. I trashed all the packages and re-ran composer update to install them all fresh again and now have the latest versions.
All seems to be working fine now. Thanks again for the support!
-
AuthorPosts
- You must be logged in to reply to this topic.