Skip to content
Snippets Groups Projects

Resolve #3518253 "Sdcs with optional"

Closes #3518253

Merge request reports

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Lee Rowlands
  • Dave Long added 30 commits

    added 30 commits

    Compare with previous version

  • Dave Long resolved all threads

    resolved all threads

  • Dave Long added 1 commit

    added 1 commit

    Compare with previous version

  • Dave Long added 20 commits

    added 20 commits

    Compare with previous version

  • Dave Long added 1 commit

    added 1 commit

    Compare with previous version

  • Dave Long added 1 commit

    added 1 commit

    • 4a950d32 - Add test coverage for optional image with heading SDC.

    Compare with previous version

  • Lee Rowlands
  • Looking good

  • Lee Rowlands left review comments

    left review comments

  • Dave Long added 1 commit

    added 1 commit

    Compare with previous version

  • Dave Long resolved all threads

    resolved all threads

  • Dave Long
  • 364 363
    365 364 $prop_field_definitions = $settings['prop_field_definitions'];
    366 365
    367 $component = $form['#component'];
    368 \assert($component instanceof ComponentEntity);
  • Dave Long
  • 380 374 continue;
    381 375 }
    382 376 $component_prop = ComponentPropExpression::fromString($component_prop_expression);
    383 $storable_props[] = $component_prop->propName;
    384 }
    385 foreach ($storable_props as $sdc_prop_name) {
  • Dave Long
  • 398 388 $disabled = !$source instanceof DefaultRelativeUrlPropSource;
    399 389 $source = $this->getDefaultStaticPropSource($sdc_prop_name)->withValue($prop_source_array['value'] ?? NULL);
    400 390 }
    391 }
    392 elseif (!$is_required) {
    • Author Maintainer

      This is the actual fix here; optional props must be missing entirely from the array, and then SDC handles them correctly; if you pass NULL or an empty array then the prop is considered present but then the required src property is missing. So in the case of the SDC config form with an optional prop we need to fall back and provide the default prop source, because the client didn't send it at all.

    • Please register or sign in to reply
  • Wim Leers added 10 commits

    added 10 commits

    • 7e5695db...328b8a3c - 9 commits from branch project:0.x
    • 832b2b01 - Merge remote-tracking branch 'origin/0.x' into 3518253-sdcs-with-optional

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading