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?

CommentFileSizeAuthor
#4 mayo.settings.txt2.49 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dpovshed created an issue. See original summary.

dpovshed’s picture

Title: Error on installing via Drush » Error on installing via Drush: Invalid data type in config mayo.settings
Issue summary: View changes
jhodgdon’s picture

Related issues: +#2790873: Missing schema

I 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...

jhodgdon’s picture

Status: Active » Needs review
FileSize
2.49 KB

Also, 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.

Balu Ertl’s picture

@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.

anthonyf’s picture

I had the same error reported here when installing Mayo theme. I can confirm that quoting the percent signs fixed the issue for me.

shweta__sharma’s picture

Hi,
i am getting the same error while installing the theme but the issue is resolved with the above given solution.