You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if the title of this issue sounds a bit harsh. I'm not a native English speaker, so no offense intended. ;)
I have recently submitted issue #12 and you created the TagsWithSameValueTest.php test class for verifying that. I can indeed confirm that my original issue does not occur in this test class.
Puzzled by this, I tried around a bit and found out that my original problem does not occur when creating a new node (This is what's being done in TagsWithSameValueTest.php). It only happens when you are editing an existing node.
The cause of this behaviour is the following: array_diff($this->getTags(), $set) does compare $this->getTags() and $set.
$set contains the values of an object before your new ChangeSet is applied. Hence when you create a new object, $set is empty and array_diff($this->getTags(), $set) will save two tags with the same value. However, when you're editing an existing object, $set is not empty, and the output of array_diff will indeed not contain two tags with the same value.
I didn't submit a pull request because I'm not sure wether this problem can be replicated without changing "real" data on the OSM database.
The text was updated successfully, but these errors were encountered:
Maturion
changed the title
TagsWithSameValueTest.php not adressing the problem
tests/TagsWithSameValueTest.php not adressing the problem
Mar 1, 2017
Maturion
added a commit
to Maturion/Services_Openstreetmap
that referenced
this issue
Mar 1, 2017
Sorry if the title of this issue sounds a bit harsh. I'm not a native English speaker, so no offense intended. ;)
I have recently submitted issue #12 and you created the TagsWithSameValueTest.php test class for verifying that. I can indeed confirm that my original issue does not occur in this test class.
Puzzled by this, I tried around a bit and found out that my original problem does not occur when creating a new node (This is what's being done in TagsWithSameValueTest.php). It only happens when you are editing an existing node.
The cause of this behaviour is the following:
array_diff($this->getTags(), $set)
does compare$this->getTags()
and$set
.Values are assigned to $set this way:
$set contains the values of an object before your new ChangeSet is applied. Hence when you create a new object, $set is empty and
array_diff($this->getTags(), $set)
will save two tags with the same value. However, when you're editing an existing object, $set is not empty, and the output ofarray_diff
will indeed not contain two tags with the same value.I didn't submit a pull request because I'm not sure wether this problem can be replicated without changing "real" data on the OSM database.
The text was updated successfully, but these errors were encountered: