Creating a simple Meta Box and trying to use the shortcode generates save error
Support › MB Frontend Submission › Creating a simple Meta Box and trying to use the shortcode generates save error
- This topic has 13 replies, 3 voices, and was last updated 3 years, 9 months ago by
Jim Hunter.
-
AuthorPosts
-
July 16, 2021 at 4:40 PM #29546
Jim Hunter
ParticipantI have a new WP install with ONLY Meta Box and AIO plugins installed. I created a simple CPT called attendee. I then created 2 custom fields for 'First Name', 'Last Name' in a field group assigned to Attendee. So far, simple. It works as a CPT and I can enter in first/last name info. I added the shortcode, as created by Meta Box, to a test page and tried to update the page, but I always get:
Updating failed. The response is not a valid JSON response
If I capitalize the first letter of the ID, the save works, but naturally when you view the page in the front end, it is just a title and content, no custom fields because the field group name did not match exactly. But when it does match, you can't save the page. Here is the shortcode I am trying to use:
[mb_frontend_form id="attendee_group" post_fields="title,content"]
Thanks,
JimJuly 16, 2021 at 7:26 PM #29550Long Nguyen
ModeratorHi Jim,
Thank you for reaching out.
Can you please share some screenshots of the field groups? You can copy the shortcode in the list group fields board and add it to the shortcode when editing the page.
Screenshots
https://share.getcloudapp.com/4gunp9Nk
https://share.getcloudapp.com/NQuoGr5kJuly 17, 2021 at 1:16 AM #29553Jim Hunter
ParticipantThanks for the quick response! That is exactly what I did, created a field group with 2 fields, copied the shortcode then added it into the page. Then it would not save. I have attached a few shots to illustrate. Scratch that, do not have time to create a place in the cloud to put them, thought I could just attach the images directly. I'll post some images tonight when I get back home, heading out for the day right now.
I purchased the developer bundle last night, so that is what I am using.July 17, 2021 at 3:35 PM #29558Jim Hunter
ParticipantHere are the screen shots
Group setup
Group listing
Page with shortcode and error when savingJuly 18, 2021 at 10:32 AM #29564Long Nguyen
ModeratorHi Jim,
I've tried to reproduce the issue on my local site but do not see anything wrong. Adding the shortcode to a page and save the content as well.
Please try to delete the field group, create another one, change the group title to "Attendee Group" and let Meta Box generates the field group ID automatically.
Or you can try to use the plugin Classic Editor to add the shortcode to the page content.
https://wordpress.org/plugins/classic-editor/Let me know how it goes.
July 19, 2021 at 12:52 PM #29573Jim Hunter
ParticipantNope, no go. I can save the shortcode to the page, no error (using classic editor), but when you display the page the form does not display. If I use an ID that does not exist, I do get a form that just has the title and content. But if I use an ID of the new group I created, then the form does not display at all. It doesn't matter if I have classic editor enabled or not, the page displays the same. If you want to contact me directly, I can set you up with a login to see what I am seeing?
Thanks,
JimJuly 19, 2021 at 1:55 PM #29574Long Nguyen
ModeratorHi Jim,
Please share your site credentials via this contact form https://metabox.io/contact/, I will help you to check the issue.
July 19, 2021 at 2:10 PM #29576Jim Hunter
ParticipantI just sent them, thanks!
Jim
July 19, 2021 at 8:32 PM #29586Ole Poetter
ParticipantHi,
I have the same problem.
Any solution for this?On the page where the shordcode is added, i get following Error:
Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-yoast-seo/class-mb-yoast-seo.php:21 Stack trace: #0 /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-includes/class-wp-hook.php(292): MB_Yoast_SEO->enqueue() #1 /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #2 /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-includes/plugin.php(484): WP_Hook->do_action() #3 /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-content/plugins/meta-box/inc/meta-box.php(179): do_action() #4 /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submission/src/Form.php(82): RW_Meta_Box->enqueue() #5 /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-frontend-submis in /var/www/vhosts/xn--rderkids-n4a.de/test.xn--rderkids-n4a.de/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-yoast-seo/class-mb-yoast-seo.php on line 21
Yoast Seo is not installed and the MB extension is not active.
July 19, 2021 at 9:05 PM #29587Long Nguyen
Moderator@Ole: Please follow this topic https://support.metabox.io/topic/fatal-error-after-last-update/ or create a new one. Your issue looks unrelated to the issue of Jim.
@Jim: Can you please resend it? I've not received your ticket.July 20, 2021 at 2:23 AM #29590Jim Hunter
ParticipantMy apologies, missed the link to create a 'ticket', I created a general message apparently.
I just sent a ticket in.July 20, 2021 at 9:02 AM #29591Long Nguyen
ModeratorHi Jim,
It might be a caching issue. I didn't see any issue with the frontend submit shortcode on your site
[mb_frontend_form id="attendee_group" post_fields="title,content" post_type="attendee"]
Screenshot https://imgur.com/L7Y9kmR
July 20, 2021 at 1:48 PM #29593Jim Hunter
ParticipantFYI, I installed MB on a different domain (one that is up and running fine), hosted on a different server/different company, and when I try and create custom fields, the entire area where you define the fields goes blank. So far I am 0 for 2 on getting this to work. And it didn't matter if Classic Editor was enabled or not, same behavior.
July 20, 2021 at 2:28 PM #29594Jim Hunter
ParticipantWell if that don't take the cake. I did everything to make it work, but it works for you right off. I even disabled the cache on the site because that occurred to me as a potential issue.
On with my testing.
Thanks for your tenacity in assisting me.
Jim
-
AuthorPosts
- You must be logged in to reply to this topic.