• Resolved myheart61

    (@myheart61)


    Hello Roland,
    I am not able to delete a photo in the pdb_record.
    There is the little red input field with “delete”, which is clicked, and the system says that the modification has been saved, but the database entry does not change.
    Do you have any idea what happens here ?

    Thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author xnau webdesign

    (@xnau)

    I’m not sure why this isn’t working for you. I would suggest you turn plugin debugging on. This is in the plugin settings under the advanced tab. Once that is on, test the issue, then look in the debugging log to see if there was a problem.

    Thread Starter myheart61

    (@myheart61)

    Roland,
    nothing specific in the debug log.

    Participants_Db::process_form storing record: UPDATE wp_participants_database SET date_updated = NOW(), photo = ‘catarina_2017_klein.jpg’, first_name = ‘Jean’, last_name = ”, address = ”, city = ”, country = ‘France’, zip = ”, phone = ”, email = ”, website = ” WHERE id = 1372

    Now when I switch in the settings that the user can delete files and photos, the photo field in the database entry gets deleted (which is what I want) but also the photo itself gets deleted from the upload directory (what I don’t want).
    I can of course change the photo for the database entry, but I would like to put no photo for the database entry.
    Thank you

    Plugin Author xnau webdesign

    (@xnau)

    I see…well, the only way to allow the user to delete the image from their record but not actually delete the image file is to move or copy the image file to another location.

    If you need more control over how images are managed, try the Image Expansion Kit add-on.

    Thread Starter myheart61

    (@myheart61)

    Ok I will think about it.
    Nevertheless, from a UI point of you, I’d find it more logical to have this red delete checkbox in the record display only in the case the user is allowed to delete, from the plugin settings.
    If not he wonders why nothing is happening, even when the checkbox is checked.

    Plugin Author xnau webdesign

    (@xnau)

    Yes, you’re right, it looks like there is a bug here. I was unaware of the problem, so thanks.

    The way is is supposed to work is how you want it to work: When the “Allow File Delete” setting is unchecked, the image is deleted from the user’s record, but the file will remain on the server. The delete button is supposed to work in both cases from the user’s perspective.

    Thread Starter myheart61

    (@myheart61)

    OK, great. Not a big deal I guess;-)
    It should be sufficient to put the IF condition where you check the admin role and the plugin setting which allows the file delete directly before the “delete_file” call.

    Plugin Author xnau webdesign

    (@xnau)

    that’s correct.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘pdb_record: Delete of photo does not work’ is closed to new replies.