Skip to content

Uploading a document twice creates an attachment record that is not deleted by plugin functionality #353

@NeilWJames

Description

@NeilWJames

when creating a document, upload a file, then upload a second one before saving the update. It will create the following records:
A) A document record with content that links to attachment 2;
B) Two attachment records (with uploaded files), both with parent being the document record;th content
C) Possibly a revision record with content that links to attachment 2.

The document deletion process looks at the content of document and the load directory irevision records and deletes the corresponding attachments and their files.

For the scenario described, this means that attachment 1 record is not deleted.

When the document record is deleted, the orphan Attachment record has its parent set to Zero. This makes it visible in the Media screen. The file will be available (and possibly deleted) if the Upload directory is iused to store documents, but if another directory is used, there will be in WordPress way to delete the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions