\Drupal\page_manager\Entity\Page::removeVariant() currently only deletes the variant config entity, but should also remove that particular variant from the list of variants stored on the page.

eg:

<?php
  unset($this->variants[$variant_id]);
?>

Comments

yanniboi created an issue. See original summary.

yanniboi’s picture

Status: Active » Needs review
StatusFileSize
new390 bytes
andrewbelcher’s picture

Status: Needs review » Closed (duplicate)

Marking this as a duplicate of #2692397: Adding/removing variants leaves Page::$variants out of date which I'll merge it into.

andrewbelcher’s picture