- πΊπΈUnited States smustgrave
To me this is a won't fix as #2 mentions losing type comparison.
If still a valid bug then a test case should be added to show this issue.
Thanks
Imagine we generated this config file programatically:
system.theme.yml
:
admin: seven
langcode: en
default: starterkits
In active config we have:
admin: seven
default: starterkits
langcode: en
The order is not the same but keys and values are fine, however drupal tell me that there are differences.
I check the code in core/lib/Drupal/Core/Config/StorageComparer.php
:
protected function addChangelistUpdate($collection) {
$recreates = [];
foreach (array_intersect($this->sourceNames[$collection], $this->targetNames[$collection]) as $name) {
$source_data = $this->getSourceStorage($collection)->read($name);
$target_data = $this->getTargetStorage($collection)->read($name);
if ($source_data !== $target_data) {
...
This line if ($source_data !== $target_data) {
, compares by identity:
$a === $b is TRUE if $a and $b have the same key/value pairs in the same order and of the same types.
If we change from:
if ($source_data !== $target_data) {
to:
if ($source_data != $target_data) {
Drupal do not see changes with the example shown above, how I expect.
We compare by equality:
$a == $b is TRUE if $a and $b have the same key/value pairs.
Here i upload a patch for that.
What do you think?
Source:
https://www.php.net/manual/en/language.operators.array.php
https://stackoverflow.com/questions/5678959/php-check-if-two-arrays-are-...
Closed: won't fix
10.1 β¨
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
To me this is a won't fix as #2 mentions losing type comparison.
If still a valid bug then a test case should be added to show this issue.
Thanks