[wp-trac] [WordPress Trac] #10511: Enclosure Custom Fields are automatically deleted

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 2 15:55:43 UTC 2012


#10511: Enclosure Custom Fields are automatically deleted
--------------------------+-----------------------------
 Reporter:  animepulse    |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  high          |   Milestone:  Future Release
Component:  Feeds         |     Version:  2.8
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------------

Comment (by nacin):

 I hate having content deleted as much as the next person. This is just
 awful. We never should have been using an unrestricted meta key that was
 editable/addable via the UI. The moment it was reported that [11315] ended
 up deleting manually added enclosures, it should have been reverted and a
 more compatible solution should have been found.

 Possible way out:

  * We assume that all current enclosure meta keys are valid. On upgrade,
 we update every `enclosure` meta_key to be `_enclosure`. This makes it
 protected, immediately.

  * We update the custom fields box to show _enclosure meta keys, in a
 special un-edited form.

  * We filter on the metadata fetch for 'enclosure' and prepend any
 '_enclosure' fields.

  * On save, we continue to delete _enclosure keys that are no longer
 linked, as well as invalidating them if they are no longer audio or video,
 as well as updating the URL if there is a redirect we can follow, and
 updating the mime type or content length if it changes.

  * On save, we take any new 'enclosure' meta keys at face value.

 Other possible way:

  * For all automatic enclosures, we include an extra line of data that
 indicates it is linked from the post. Only enclosures that have this data
 can be deleted automatically. All enclosures with this data are made read-
 only in the custom fields UI.

  * All existing enclosures are therefore protected, unless they are
 linked, at which point they will end up being considered "automatic"
 links, and then unlinked, at which point they will be removed.

 Perhaps there is an amalgamation between these two ideas. I'm probably
 missing quite a bit here. As I posted [http://wordpress.org/support/topic
 /enclosure-custom-field-erasing-after-saving-
 post/page/2?replies=41#post-2598436 in the support forums], I have little
 experience here. And so that said, since this ticket is three years old, I
 wouldn't expect a quick fix.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10511#comment:24>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list