Skip to content
Snippets Groups Projects

Resolve #3230826 "Sorted config"

Open Wim Leers requested to merge issue/drupal-3230826:3230826-sorted-config into 11.x

Closes #3230826

Merge request reports

Members who can merge are allowed to add commits.
Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 293 294
    295 /**
    296 * {@inheritdoc}
    297 */
    298 public function getCanonicalRepresentation(): array {
    299 $representation = [];
    300
    301 // Mapping keys should be ordered however the data definition says.
    302 // Note: this specifically does NOT use required/optional keys, because this
    303 // MUST work even on invalid data (i.e. when required keys are missing).
    304 $ordered_mapping_keys = $this->getValidKeys();
    305
    306 // Generate a representation of this mapping:
    307 // 1. defer to each value's own canonical representation
    308 // (::getElements() respects the stored order in $this->value, not the
    309 // schema order)
    • Comment on lines +308 to +309

      This isn't documented on TypedConfigInterface::getElements(). Should it be? Or is it just an internal detail of ArrayElement? If it's the latter, then we need to assert($this instanceof ArrayElement).

    • Author Developer

      See \Drupal\Core\Config\Schema\ArrayElement::parse(). You're right it isn't documented though. Let's do assert($this instanceof ArrayElement)?

    • Sure. That said, if ArrayElement ever changes its mind, then this assumption could break.

      But I guess the comment should at least state, outright, that we expect getElements() to respect the order stored in $this->value.

    • Author Developer

      Instead tweaked the comment on \Drupal\Core\Config\Schema\TypedConfigInterface::getElements() in 25a33a0c.

    • Wim Leers changed this line in version 16 of the diff

      changed this line in version 16 of the diff

    • Please register or sign in to reply
  • Adam G-H
  • Wim Leers added 1 commit

    added 1 commit

    • 87bdacaa - Use the same protection against the PHP "resource" type as before.

    Compare with previous version

  • Adam G-H
  • Adam G-H
  • Adam G-H
  • Adam G-H
  • 22 22 * {@inheritdoc}
    23 23 */
    24 24 public function getCastedValue() {
    25 if ($this->value === NULL) {
    26 return NULL;
    27 }
    28
  • Adam G-H
  • Adam G-H
  • Adam G-H
  • Wim Leers added 1 commit
  • Wim Leers added 1 commit

    added 1 commit

    Compare with previous version

  • Wim Leers added 1 commit

    added 1 commit

    • f2c1390d - Add new `$suppress_exceptions` argument to `::getCanonicalRepresentation()`,...

    Compare with previous version

  • Fabian Bircher
  • Wim Leers added 1 commit

    added 1 commit

    • 60631295 - Update `ViewExecutable::save()` to not rely on array references to internal...

    Compare with previous version

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