Issue #3367477: Compatibility with version 2.x of dependencies and SDC in Core
9 open threads
Merge request reports
Activity
added 1 commit
- 9fe8cb0e - Added DependencySerializationTrait to block form to support multivalue ajax loaded elements
added 1 commit
- c2dacbdb - Changed transform to doTransform in componentForm
127 121 'current_input' => $current_input, 128 122 'form' => $form, 129 123 ]); 130 $element = $this->formGenerator->transform($schema, $context); 124 // @todo investigate why the new components schema is failing in the 125 // validation when using the transform method, doing doTransform directly. 126 $element = $this->formGenerator->doTransform($schema, $context); 89 if (isset($filters_statuses) && is_array($filters_statuses)) { 90 $statuses = array_keys(array_filter($form_state->getValue(['filters', 'statuses']))); 91 } 92 93 $forbidden = []; 94 $filters_refine_forbidden = $form_state->getValue(['filters', 'refine', 'forbidden']); 95 if (isset($filters_refine_forbidden) && is_array($filters_refine_forbidden)) { 96 $forbidden = array_keys(array_filter($form_state->getValue(['filters', 'refine', 'forbidden']))); 97 } 98 99 $allowed = []; 100 $filters_refine_allowed = $form_state->getValue(['filters', 'refine', 'allowed']); 101 if (isset($filters_refine_allowed) && is_array($filters_refine_allowed)) { 102 $allowed = array_keys(array_filter($form_state->getValue(['filters', 'refine', 'allowed']))); 103 } 104 42 $components = $this->componentManager->getFilteredComponentTypes( 42 $components = $this->componentManager->getFilteredComponents( 43 43 $settings->get('allowed'), 44 44 $settings->get('forbidden'), 45 $settings->get('types'), 46 45 $settings->get('statuses'), 47 46 ); 48 47 $this->derivatives = \array_reduce( 49 48 $components, 50 49 function (array $carry, Component $component) use ($base_plugin_definition) { 51 $carry[$component->getId()] = array_merge($base_plugin_definition, [ 52 'admin_label' => $component->getMetadata()->getName(), 53 'category' => $this->t('CL Components'), 50 $carry[$component->getPluginId()] = array_merge($base_plugin_definition, [ 51 'admin_label' => $component->metadata->name, 52 'category' => $this->t('CL Block'), 25 25 * weight = 100, 26 26 * settings = { 27 27 * "filters" = { 28 * "types" = {Drupal\cl_components\Component\ComponentMetadata::COMPONENT_TYPE_ORGANISM}, 29 28 * "statuses" = { 30 * Drupal\cl_components\Component\ComponentMetadata::COMPONENT_STATUS_READY, 31 * Drupal\cl_components\Component\ComponentMetadata::COMPONENT_STATUS_BETA, 29 * Drupal\Core\Extension\ExtensionLifecycle::STABLE, 20 20 * @Filter( 21 21 * id = "cl_block", 22 22 * title = @Translation("Embed CL Components"), 23 23 * description = @Translation("Embeds CL Components using data attributes: data-component-id, data-component-variant and data-component-settings. Should usually run as the last filter, since it does not contain user input."), 221 * 222 * @return array 223 * The slots as render arrays. 224 */ 225 private function getSlotsRender($twig_blocks) { 226 $slots = []; 227 foreach ($twig_blocks as $id => $config) { 228 $slots[$id] = [ 229 '#type' => 'processed_text', 230 '#text' => $config['value'], 231 '#format' => $config['format'], 232 ]; 233 } 234 return $slots; 235 } 236 - Comment on lines +216 to +236
216 /** 217 * Get slot render elements. 218 * 219 * @param array $twig_blocks 220 * The array of twig block. 221 * 222 * @return array 223 * The slots as render arrays. 224 */ 225 private function getSlotsRender($twig_blocks) { 226 $slots = []; 227 foreach ($twig_blocks as $id => $config) { 228 $slots[$id] = [ 229 '#type' => 'processed_text', 230 '#text' => $config['value'], 231 '#format' => $config['format'], 232 ]; 233 } 234 return $slots; 235 } 236
120 117 ->token 121 118 ->replace($data['value'], $token_data, $token_options, $bubbleable_metadata); 122 119 return [ 123 '#type' => 'cl_component', 124 '#component' => $component->getId(), 125 '#variant' => $variant, 126 '#twig_blocks' => $twig_blocks, 127 '#context' => $context, 120 '#type' => 'component', 121 '#component' => $component->getPluginId(), 122 '#slots' => $this->getSlotsRender($twig_blocks), 1 1 cl_block.registry_tab: 2 2 title: Blocks 3 description: Configure how blocks are generated from CL Components 3 description: Configure how blocks are generated from Components changed this line in version 4 of the diff
25 25 * label = @Translation("Node")), 26 26 * "user" = @ContextDefinition("entity:user", required = FALSE, 27 27 * label = @Translation("User Context"), constraints = { "NotNull" = {} }, 28 28 * ),
Please register or sign in to reply