When a parent entity is being published, all uses of those media items should be automatically updated to the latest revision of the media items.

This should do two things:

  1. Update the "media_vid" value to point to the latest revision.
  2. Identify every entity_type/entity_id which uses this media item and update it to point to the new revision.

This opens up a major issue:

  • Revision history of nodes which have media attached will loose their correlation, so the revision history will become inaccurate.

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new6.27 KB

I think this might work.

Status: Needs review » Needs work

The last submitted patch, 3: media_reference_revisions-n3002609-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new6.27 KB
new781 bytes

Forgot to set a default on a new argument.

  • DamienMcKenna committed 817286c on 8.x-1.x
    Issue #3002609 by DamienMcKenna: Automatically update all other...
damienmckenna’s picture

Status: Needs review » Fixed

Committed.

damienmckenna’s picture

Status: Fixed » Needs review
StatusFileSize
new445 bytes

Forgot a part :-\

Status: Needs review » Needs work

The last submitted patch, 8: media_reference_revisions-n3002609-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new531 bytes
new787 bytes

Dangit.

Status: Needs review » Needs work

The last submitted patch, 10: media_reference_revisions-n3002609-10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new1.36 KB

Updated the test as the first record is now also updated.

Status: Needs review » Needs work

The last submitted patch, 12: media_reference_revisions-n3002609-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new2.66 KB
new3.27 KB

Fixed the tests.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed 32f79c2 on 8.x-1.x
    Issue #3002609 by DamienMcKenna: Missed changes from earlier commit.
    
  • DamienMcKenna committed fc9e884 on 8.x-1.x
    Issue #3002609 by DamienMcKenna: Missed changes from earlier commit.
    
damienmckenna’s picture

StatusFileSize
new467 bytes

I think the ID was incorrect.

damienmckenna’s picture

Status: Fixed » Needs review

damienmckenna’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.