paragraphs_browser.install in Paragraphs Browser 8
File
paragraphs_browser.install
View source
<?php
function paragraphs_browser_update_8001() {
$entityTypeManager = \Drupal::entityTypeManager();
$paragraphsTypeStorage = $entityTypeManager
->getStorage('paragraphs_type');
$paragraphsType = $paragraphsTypeStorage
->loadMultiple();
foreach ($paragraphsType as $paragraphType) {
$paragraphsBrowserSettings = $paragraphType
->getThirdPartySettings('paragraphs_browser');
if (!$paragraphType
->getDescription() && isset($paragraphsBrowserSettings['description'])) {
$paragraphType
->set('description', $paragraphsBrowserSettings['description']);
$paragraphType
->save();
}
}
}