Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-4774

Investigate why certain attachments have many duplicate metadata records.

    XporterXMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Must have
    • Resolution: Released
    • Affects Version/s: None
    • Fix Version/s: 2.31.2
    • Labels:
    • Story Points:
      8
    • Sprint:
      Sprint #132, Sprint #133
    • Section:
      Campaigns, Media Library
    • P4 site:
      All sites
    • Track:
      Development
    • Repositories:
      planet4-master-theme, planet4-plugin-gutenberg-blocks

      Description

      Certain attachments have many duplicate metadata records. Something must be creating these, possibly on every save. It could be that the metadata is updated with 

      add_post_meta(...)

      instead of with

      update_post_meta(...)

      both functions have the result that the new value is used and create a record if there is none yet. However add_post_meta will always create a new record, after which the old record lingers in the database and is never used again.

      Tasks:

      • Find out which code is creating instead of updating these records.
      • Investigate if we should use a plugin or post-deploy script to clean up old records, as they might affect performance.
      • Create follow up task if needed

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                sdeshmuk Sagar Deshmukh
                Reporter:
                pvincent Pieter Vincent
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: