Appnitro Software Forums » MachForm 2

BUG: edit not possible when photo field is required


  1. Peter4u
    Member

    Can this bug be fixed asap?

    When editing an entry as an Admin, which has a required FILE UPLOAD field, the file itself needs to be reuploaded in order to save the edit, which is pretty annoying if the file doesn't need an edit. It would be nice if the original file could stay unchanged during an edit.

    And maybe a feature request, add a button to delete an uploaded file.

    Posted 3 years ago #
  2. redityo

    Hi,

    I see ... Since the element is required it will do a validation when you want to insert/update the data. Maybe you can do small hack for handle that problem. You can add these code to "include/post-functions.php" file on line 1950, It will by pass required validation for element file in edit entry.

    $element_info[$element_id]['is_required'] = false;

    and for delete file button, Machform 2.0g already have that feature. maybe you're using old version of Mahcform ?


    MachForm Support

    Posted 3 years ago #
  3. This is a bug indeed.

    The solution is posted by redityo above. To make it clear, on line 1949 you'll find this code:

    }elseif ('file' == $element_type){ //File

    right below that line, insert the code as posted by redityo:

    $element_info[$element_id]['is_required'] = false;

    that should fix the bug.

    This bugfix should be included for the next machform package. Thank your for reporting this!

    To delete an uploaded file, when you edit an entry click the "Delete" link below your upload field.


    MachForm Founder

    Posted 3 years ago #

RSS feed for this topic

Reply