Error : "Invalid File" when delete image - Custom Field - User - Type : Image

Support General Error : "Invalid File" when delete image - Custom Field - User - Type : ImageResolved

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #30478
    justdoit123justdoit123
    Participant

    In Custom Field for User - Type : Image.
    I set limit 3 images and checked: Force delete

    When i choose and upload an Image and Save, it show thumbnail, it worked.

    but when i press X to delete that image.

    it alert and not delete the image :: Error : Invalid File

    Please see screenshot: https://vm.d.pr/wHQ8Jv

    #30491
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I do not experience that issue on my end. It is possible the image was deleted and was not removed in a short time and you click button X one more time. Please try to follow the Debugging Information step https://support.metabox.io/topic/how-to-create-a-new-topic/ and test this function again.

    #30515
    justdoit123justdoit123
    Participant

    hi, i tried in many hosting to VPS.

    Please login here and see:

    https://metaboxtest.tastewp.com/wp-admin/profile.php
    (removed)

    this is just a test site, please go to : wp-admin/profile.php

    and scroll down to meta Image. Click x to delete an image and an alert will appear

    #30516
    justdoit123justdoit123
    Participant

    i tested with admin role, editor, author role, same error, when i press X to delete that image.

    it alert and not delete the image :: Error : Invalid File, cannot delete image after save.

    #30518
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    You can still delete the images but it shows the wrong message, screen record https://share.getcloudapp.com/eDuRRXeR

    This issue might happen when the image field is a subfield inside a group. I will inform the development team to fix this in the next update.

    #30519
    justdoit123justdoit123
    Participant

    Hi, it is only deleted in front, images are still there in Media : /wp-admin/upload.php

    #30520
    justdoit123justdoit123
    Participant

    if i choose Image Advanced or Image upload, they will be deleted in Media too.

    btw, can you add this feature to : Image Advanced or Image upload : real limit on choosing maximum images, i can still choose more than maximum and upload it to Media, Your limit only for frontend show up thumbnail.

    #30529
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please use the field image or file as a top field, not a subfield to delete images/files when clicking "X" button. This issue will be fixed in the next update.

    Regarding the feature limit images on select, I will inform the development team to explore the possibility.

    #34618
    sherwin_flightsherwin_flight
    Participant

    Hi Long,

    You previously mentioned "Please use the field image or file as a top field, not a subfield to delete images/files when clicking "X" button. This issue will be fixed in the next update."

    Was this bug fixed?

    #34695
    Long NguyenLong Nguyen
    Moderator

    Hi Sherwin,

    This issue has been fixed from version 5.4.7 of Meta Box. Can you please confirm it works?

    #35221
    sherwin_flightsherwin_flight
    Participant

    Ok, it seems I currently have version 5.4.0 installed.

    I can probably get the newer version from my theme provider since I still have an active license with them and they may have already updated the theme.

    If I want to update the bundled version of Metabox without updating the entire theme, can I just take the Metabox files from the updated version of the theme and just overwrite my current Metabox files with them?

    The theme also came with some of the premium plugins bundled as well. Would those also need to be updated, or just Metabox Core?

    Thanks for your help.

    #36989
    sherwin_flightsherwin_flight
    Participant

    I have version 5.6.1 now, but I still seem to be having this problem.

    I have a clone group set up, and there's an image file in it. I can clone the field and upload the images, that seems to all work as expected. But if I try to delete the files using the ajax delete option I can only delete one of the files. For the others I get the Invalid File! error.

    The code that calls the error pop-up is:

    		if ( ( 'child' !== $type && ! in_array( $attachment, $field_value ) ) ||
    			 ( 'child' === $type && ! in_array( $attachment,  self::get_sub_values( $field_value, $request->filter_post( 'field_id' ) ) ) ) ) {
    			wp_send_json_error( __( 'Error: Invalid file', 'meta-box' ) );
    		}

    When I debug it a little it seems the array returned by the "self::get_sub_values" function returns a single entry, despite having added two clone groups with images. So I am able to delete the image that matches the one returned by this function, but for the others I get an error.

    So the error is related to how the "self::get_sub_values" is building the array of values. it's not including all of my uploaded files.

    #37062
    Long NguyenLong Nguyen
    Moderator

    Hi @sherwin_flight

    Please update the Meta Box plugin to the latest version 5.6.5 and re-check this issue. Let me know how it goes.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.