Initial improvements for template creation.
Closes #3492704
Merge request reports
Activity
assigned to @primsi
357 360 } 358 361 359 362 $termStorage = $this->entityTypeManager->getStorage('taxonomy_term'); 360 $values = [ 361 'langcode' => $language->getId(), 362 ]; 363 363 $settings = $field->getSetting('handler_settings'); 364 364 365 // @todo This can potentially create lot's of options there. 366 $values = []; 367 if ($field->isTranslatable()) { 368 $values['langcode'] = $language->getId(); 376 382 'label' => $term->label(), 377 383 ]; 378 384 385 if (!$term->hasField('contentworkflowbynder_option_ids')) { 387 397 $term->save(); 388 398 } 389 399 400 if (empty($options)) { 401 throw new \Exception('No terms found to populate checkbox options.'); changed this line in version 3 of the diff
402 } 403 390 404 $metadata = [ 391 405 'choice_fields' => [ 392 406 'options' => $options, 393 407 ], 394 408 ]; 395 409 } 396 397 if ($field->getType() === 'entity_reference_revisions') { 410 elseif ($field->getType() === 'entity_reference_revisions') { 398 411 $settings = $field->getSetting('handler_settings'); 399 412 400 413 if (empty($settings['target_bundles'])) { 401 continue; 414 continue; changed this line in version 3 of the diff
451 'field_type' => $fieldType, 452 'label' => $fieldLabel, 453 'component' => array_merge(['uuid' => $this->uuidService->generate()], $componentsFields), 454 ]; 455 } 456 else { 457 $group['fields'][] = [ 458 'uuid' => $fieldUuid, 459 'field_type' => $fieldType, 460 'label' => $fieldLabel, 461 'metadata' => $metadata, 462 ]; 463 } 440 464 441 $fieldId = $field->id(); 465 $fieldId = ($field instanceof BaseFieldDefinition) ? $field->getName() : $field->id(); yes, but field map has for example string and entity_reference.
node.type is an entity reference field. node.uid is. I guess it actually only supports taxonomy term references?
Paragraphs have parent_id, parent_type, parent_field_name. behavior_settings as string and string_long. none of those should be mapped.
only looking at configurable fields is pretty crude, but it's a reasonable start. There might be custom entity types that only have base fields and those should be mapped, but without a whole interactive UI process (e.g. preview with checkboxes to enable/disable), we should stick to configurable fields for now. it's possible that I initially said something else.
31 32 'is_ascii' => FALSE, 32 33 'case_sensitive' => FALSE, 33 34 ], 34 ])->save(); 35 ]); 36 $field_storage->save(); 37 38 foreach (Vocabulary::loadMultiple() as $vocabulary) { changed this line in version 3 of the diff
180 196 'content_workflow_bynder_entity_mapping' => _content_workflow_bynder_entity_mapping_spec(), 181 197 ]; 182 198 } 199 200 /** 201 * Add identifier fields to taxonomy terms. 202 */ 203 function content_workflow_bynder_update_10101() { changed this line in version 3 of the diff
added 1 commit
- 513ceaf6 - Template creation improvements: partial review addressing.
5 5 * Install and uninstall script for Content Workflow module. 6 6 */ 7 7 8 use Drupal\Core\Database\Database; 9 8 use Drupal\Core\Field\FieldStorageDefinitionInterface; 10 9 use Drupal\field\Entity\FieldConfig; 11 10 use Drupal\field\Entity\FieldStorageConfig; 12 11 use Drupal\content_workflow_bynder\Entity\Mapping; 12 use Drupal\taxonomy\Entity\Vocabulary; 13 13 14 14 15 /** 15 16 * Implements hook_install(). 16 17 */ 17 18 function content_workflow_bynder_install() { 18 if (\Drupal::entityTypeManager()->hasDefinition('taxonomy_term')) {