Skip to content
Snippets Groups Projects

Issue #3395960 : Add new feature field formatters module

Closed Issue #3395960 : Add new feature field formatters module

Merge request reports

Closed by Thomas MUSAThomas MUSA Apr 3, 2024 (Apr 3, 2024 11:18am UTC)

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
25 25 */
26 26 public function alter(array $element) {
27 27 $element = $this->cleanSlotsValues($element);
28 if (empty($element['#slots'])) {
29 $element['#slots'] = [];
30 }
31 $element['#propsAlter'] = [];
  • Trigerring fatal : | TypeError: array_reduce(): Argument #1 ($array) must be of type array, null given in array_reduce() (line 58 of /var/www/html/web/core/modules/sdc/src/Element/ComponentElement.php).

  • Please register or sign in to reply
  • 25 25 */
    26 26 public function alter(array $element) {
    27 27 $element = $this->cleanSlotsValues($element);
    28 if (empty($element['#slots'])) {
    • Trigerring fatal | TypeError: Drupal\sdc\Element\ComponentElement::generateComponentTemplate(): Argument #2 ($slots) must be of type array, null given, called in /var/www/html/web/core/modules/sdc/src/Element/ComponentElement.php on line 67 in Drupal\sdc\Element\ComponentElement->generateComponentTemplate() (line 98 of /var/www/html/web/core/modules/sdc/src/Element/ComponentElement.php).+

    • Please register or sign in to reply
  • 57 57 protected function buildProps(array $build, Component $component, array $configuration, array $contexts): array {
    58 58 $props = $component->metadata->schema['properties'] ?? [];
    59 59 foreach ($props as $prop_id => $prop_definition) {
    60 $prop_configuration = $configuration['props'][$prop_id] ?? [];
    60 $prop_configuration = $configuration['ui_patterns']['props'][$prop_id] ?? [];
  • 113 113 protected function buildSlots(array $build, Component $component, array $configuration, array $contexts): array {
    114 114 $slots = $component->metadata->slots ?? [];
    115 115 foreach ($slots as $slot_id => $slot_definition) {
    116 $slot_configuration = $configuration['slots'][$slot_id] ?? [];
    116 $slot_configuration = $configuration['ui_patterns']['slots'][$slot_id] ?? [];
  • 143 143 '#type' => 'component',
    144 144 '#component' => $component_id ?? $this->getComponentConfiguration()['component_id'],
    145 145 '#ui_patterns' => $this->getComponentConfiguration(),
    146 '#source_context' => $this->getComponentSourceContexts(),
  • 79 79 if (!$source_id) {
    80 80 return $build;
    81 81 }
    82 if (!$this->sourcesManager->isApplicable($source_id, $contexts)) {
  • 100 100 }
    101 101 }
    102 102 if ($selected_source) {
    103 $build_info = $form_state->getBuildInfo();
  • Thomas MUSA added 1 commit

    added 1 commit

    • 03c0c06e - add context on slot settings form

    Compare with previous version

  • 59 59
    60 60 /** @var \Drupal\ui_patterns\SourcePluginManager $sources_manager */
    61 61 $sources_manager = \Drupal::service("plugin.manager.ui_patterns_source");
    62 $source_ids = array_keys($sources_manager->getDefinitionsForPropType('slot', self::getComponentSourceContexts($element)));
    62 $contexts = self::getComponentSourceContexts($element);
    63
    64 $build_info = $form_state->getBuildInfo();
  • Thomas MUSA added 2 commits

    added 2 commits

    Compare with previous version

  • Thomas MUSA added 13 commits

    added 13 commits

    Compare with previous version

  • Thomas MUSA added 1 commit

    added 1 commit

    Compare with previous version

  • Thomas MUSA added 105 commits

    added 105 commits

    Compare with previous version

  • Thomas MUSA changed title from Issue #3395960 : fix new update, add context on settings form to Issue #3395960 : Add new feature field formatters module

    changed title from Issue #3395960 : fix new update, add context on settings form to Issue #3395960 : Add new feature field formatters module

  • closed

  • Please register or sign in to reply
    Loading