Why does YAML parser strippes out underscore? In my Drupal project I have a yaml configuration file which contains an id with the value 16_9 (more precisely it is part of the Crop module configuration). When checking differences between the active Drupal configuration and this staged one, Drupal lists this config, although it should be identical:



As you can see, the YAML parser processes the id as an integer and stripes out the underscore.

This problem only exists in my Drupal-VM. In our testing and production environment (non Drupal-VM) with the identical code and data base the config sync is fine. It does not show any differences.

There might be different YAML parser (and/or extensions) in use which behave not the same way. But I don't know if this is a Drupal or VM issue. I don't think that it is specific to the Crop Module.

My Environment

Vagrant 1.9.2
VirtualBox .1.18 r114002 (Qt5.6.2)
Drupal VM 4.5.0 (with Ubuntu)
It's actually a native YAML issue. As Saltstack's YAML Inconsistencies page observes:


  If a definition only includes numbers and underscores, it is parsed by YAML as an integer and all underscores are stripped. To ensure the object becomes a string, it should be surrounded by quotes.


It's fairly common practice; Java does it too, for example

So wrap your ID in quotes and it should be fine.