You are here

function external_link_popup_update_8101 in External Link Pop-up 8

Update body text to use text formats.

File

./external_link_popup.install, line 11
Contains external_link_popup installation and upgrade actions.

Code

function external_link_popup_update_8101() {
  $entities = \Drupal::entityTypeManager()
    ->getStorage('external_link_popup')
    ->loadMultiple();

  /* @var $entity \Drupal\external_link_popup\Entity\ExternalLinkPopup */
  foreach ($entities as $entity) {
    $body = $entity
      ->getBody();
    if (is_string($body)) {
      $entity
        ->setBody([
        'value' => $body,
      ])
        ->save();
    }
  }
}