Image upload options says upload error & media popup loads at the bottom
Support › MB Frontend Submission › Image upload options says upload error & media popup loads at the bottomResolved
- This topic has 3 replies, 2 voices, and was last updated 2 years, 6 months ago by
Prabakaran Shankar.
-
AuthorPosts
-
October 18, 2022 at 12:42 AM #38727
Prabakaran Shankar
ParticipantIn the frontend submission, the image_advanced, Image_upload are not working. It displays - An error occurred in the upload. Please try again later.
Also, the media pop up shows at the bottom (below footer). Append the image for visual identification.
https://1drv.ms/u/s!AjLgaRuebK87hplKFU6kTAEet8hkbw?e=xvTBSb
NOTE:
Code I have used.<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'User Profile Content', 'your-text-domain' ), 'id' => 'user-profile-content', 'post_types' => ['user-profile'], 'fields' => [ [ 'name' => __( 'Image Upload', 'your-text-domain' ), 'id' => $prefix . 'image_upload_003jih2nut6t', 'type' => 'image_upload', 'max_file_uploads' => 1, 'force_delete' => true, 'max_status' => false, ], ], ]; return $meta_boxes; }
As per note in the MB Frontend submission
add the below code in the child-functions.php filefunction mb_allow_subscriber_uploads() { if ( is_admin() ) { return; } // Replace 'subscriber' with the required role to update, can also be contributor. $subscriber = get_role( 'basic' ); $subscriber->add_cap( 'upload_files' ); } add_action( 'init', 'mb_allow_subscriber_uploads' );
However, the image option is working. Able to upload the file, but not able to edit, change or delete the image.
October 18, 2022 at 4:56 PM #38734Prabakaran Shankar
ParticipantHello,
In the image field option in the front-end form submission, there is an option to add an image. However, there is no option to edit or delete the uploaded image. There is a filter in the documentation to change the text of the edit and delete string.
NOTE:
I changed the user role to "administrator" to check the options. There is also no way for the "Administrator" to change or delete the uploaded image.October 18, 2022 at 11:05 PM #38738Long Nguyen
ModeratorHi,
It looks like the style files (CSS, JS) are not loading correctly so the option to delete the image uploaded is not displayed. It should display like this https://monosnap.com/file/GxKUSOoEB14t2tPDW1QfBj7Pv3T1Sk
Please try to deactivate all plugins except Meta Box, MB extensions and switch to the standard theme of WordPress (2022) and recheck this issue.
October 21, 2022 at 12:39 PM #38773Prabakaran Shankar
ParticipantThanks for pointing out the error
Actually it is because the 'style - dashicons' are not loading and the user roles have been blocked from accessing the 'wp-admin'
Both are blocking the process of uploading images.
Please close this ticket. -
AuthorPosts
- You must be logged in to reply to this topic.