[wp-trac] [WordPress Trac] #8490: Media Library -
Attached/Unattached logic is flawed
WordPress Trac
wp-trac at lists.automattic.com
Thu Dec 4 21:04:52 GMT 2008
#8490: Media Library - Attached/Unattached logic is flawed
---------------------+------------------------------------------------------
Reporter: hailin | Owner: anonymous
Type: defect | Status: new
Priority: high | Milestone: 2.7
Component: General | Version:
Severity: major | Keywords:
---------------------+------------------------------------------------------
In 2.7 Media Library, the tabs Attached, Unattched logic has an issue ,
and can cause user confusions and wrong output.
Current ‘Attached’ logic:
From Write post panel, user clicks upload media, the the url will contain
post_id, which is used to set post_parent for the uploaded attachement.
Ex: wp-admin/post.php?action=edit&post=8
Then the uploaded image’s post_parent field is set to 8, and as long as
post_parent is >=1, the attachment is regarded as “Attached”. Otherwise,
it’s “Not attached”.
When an image is added via “Media=>Add New”, then its post_parent is not
set, thus the image will be “Unattached”. No subsequent operation will
alter its’ post_parent, even when user inserts the image into a post.
So if users always upload images/videos via Media=>Add New, then insert
them into posts later, those images/videos will always be classified as
“Unattached”, this can cause confusion as users may intend to delete those
“unattached, thus unused” things.
I think a better logic for “attached/unattached” would be actually
scanning posts contents for inclusion. Basing this logic on a particular
operation flow is problematic and it’s difficult to guarantee the
correctness.
--
Ticket URL: <http://trac.wordpress.org/ticket/8490>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list