function taxonomy_post_update_set_vocabulary_description_to_null

Converts empty `description` in vocabularies to NULL.

File

core/modules/taxonomy/taxonomy.post_update.php, line 39

Code

function taxonomy_post_update_set_vocabulary_description_to_null(array &$sandbox) : void {
    \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'taxonomy_vocabulary', function (VocabularyInterface $vocabulary) : bool {
        // @see taxonomy_taxonomy_vocabulary_presave()
        return trim($vocabulary->getDescription()) === '';
    });
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.