Skip to content
Snippets Groups Projects

Resolve #2002174 "Validatable vocabulary"

3 unresolved threads

Closes #2002174

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 5 namespace Drupal\taxonomy\Plugin\migrate\destination;
    6
    7 use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;
    8 use Drupal\migrate\Row;
    9
    10 /**
    11 * @MigrateDestination(
    12 * id = "entity:taxonomy_vocabulary"
    13 * )
    14 */
    15 class EntityTaxonomyVocabulary extends EntityConfigBase {
    16
    17 /**
    18 * {@inheritdoc}
    19 */
    20 public function getEntity(Row $row, array $old_destination_id_values) {
  • 42 42 );
    43 43 }
    44 44
    45 /**
    46 * {@inheritdoc}
    47 */
    48 public function buildEntity(array $form, FormStateInterface $form_state) {
  • Wolfgang Ziegler
  • Wim Leers added 1 commit

    added 1 commit

    • b476747c - @fago review: tighten `EntityTaxonomyVocabulary::getEntity()`.

    Compare with previous version

  • Wim Leers added 1 commit

    added 1 commit

    • 70152bc0 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • 31 32 return TRUE;
    32 33 });
    33 34 }
    35
    36 /**
    37 * Converts empty `help` in vocabularies to NULL.
    38 */
    39 function taxonomy_post_update_set_vocabulary_description_to_null(array &$sandbox): void {
    40 \Drupal::classResolver(ConfigEntityUpdater::class)
    41 ->update($sandbox, 'taxonomy_vocabulary', function (VocabularyInterface $vocabulary): bool {
    42 // Vocabularies' `description` field must be stored as NULL at the config
    43 // level if it is empty.
    44 if (trim($vocabulary->getDescription()) === '') {
  • Wim Leers added 3 commits

    added 3 commits

    • 6b073b55 - @catch review: remove @todo; closed that issue instead.
    • aca92287 - @catch review: move update path to `taxonomy_taxonomy_vocabulary_presave()`.
    • 339c0efc - Apply the same pattern to `node_post_update_set_node_type_description_and_help_to_null()`.

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading