Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
During installation via Drush with fresh 8.2.6 core I've got the following error:
The following projects provide some or all of the extensions not found: [ok]
mayo
Would you like to download them? (y/n): y
Project mayo (8.x-1.3) downloaded to /var/www/example.com/themes/mayo. [success]
The following extensions will be enabled: mayo
Do you really want to continue? (y/n): y
exception 'Drupal\Core\Config\UnsupportedDataTypeConfigException' with message 'Invalid data type in config mayo.settings, found in [error]
filethemes/mayo/config/install/mayo.settings.yml : yaml_parse(): scanning error encountered during parsing: found character that cannot start
any token (line 43, column 28), context while scanning for the next token (line 43, column 28)' in
/var/www/example.com/core/lib/Drupal/Core/Config/FileStorage.php:117
Stack trace:
#0 /var/www/example.com/core/lib/Drupal/Core/Config/FileStorage.php(130): Drupal\Core\Config\FileStorage->read('mayo.settings')
#1 /var/www/example.com/core/lib/Drupal/Core/Config/ConfigInstaller.php(245): Drupal\Core\Config\FileStorage->readMultiple(Array)
On the reported place - line 43 col 28 - I found percentage sign. Actually there are several parameters like tablet_portrait_page_unit, tablet_portrait_sidebar_unit with percentage sign as a value. When I replaced the sign with values like '80%', '20%' installation was successful.
Probably the yaml parser, which is currrently in use, does not allow single percentage as a value, so something have to be done here?
Comment | File | Size | Author |
---|---|---|---|
#4 | mayo.settings.txt | 2.49 KB | jhodgdon |
Comments
Comment #2
dpovshed CreditAttribution: dpovshed as a volunteer and at Drupal Ukraine Community commentedComment #3
jhodgdonI think the % signs need to be quoted. I am getting this error running under 8.5.x:
Not quoting the scalar "%" starting with the "%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0 on line 77.
Also there is a duplication in the file:
Duplicate key "global_default_layout" detected whilst parsing YAML. Silent handling of duplicate mapping keys in YAML is deprecated since Symfony 3.2 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0 on line 94.
Note: Both of those line numbers refer to lines in the Symfony YAML parsing code, not lines in the mayo.settings.yml file.
See also this somewhat related issue...
Comment #4
jhodgdonAlso, the attached is what you get if you use the Configuration module in Core to export the settings -- note that the duplicated key has been omitted, and the '%' are output in quotes. So, probably this should be put into the mayo.settings.yml file. The comments that are in the YAML file currently should instead be put into the schema file instead (see related issue) as descriptions/labels.
Comment #5
Balu Ertl@jhodgdon Thank you for the hint, I stumbled into exactly the same issue, and indeed encapsulating standalone
%
characters into single quotes has solved my case as well.In your editor search for this pattern:
(\:\s*)\%
(10 occurences were for me), then replace to$1'%'
pattern.Comment #6
anthonyf CreditAttribution: anthonyf commentedI had the same error reported here when installing Mayo theme. I can confirm that quoting the percent signs fixed the issue for me.
Comment #7
shweta__sharma CreditAttribution: shweta__sharma at OpenSense Labs commentedHi,
i am getting the same error while installing the theme but the issue is resolved with the above given solution.