Loading...
 
Skip to main content

YAML: one line preference containing operand characters results in PHP fatal error when applying profile

Status
Open
Subject
YAML: one line preference containing operand characters results in PHP fatal error when applying profile
Version
15.x
Category
  • Error
Feature
Console / Command Line
Installer (profiles, upgrades and server-related issues)
Resolution status
New
Submitted by
luci
Lastmod by
luci
Rating
(0)
Description

While working on a profile with exported preferences from tiki-admin.php?page=profiles&cookietab=2 I have realized when trying to apply that YAML code as a local profile using the following command:
php console.php profile:apply my-preferences profiles

the result is fatal error:

Copy to clipboard
PHP Fatal error: Unsupported operand types in /var/www/clients/client1/web16/subdirs/.../lib/core/Horde/Yaml/Loader.php on line 363


The problem is my profile YAML file (which I saved as my-preferences.yml in a profiles/ dir) contains one line preferences like this:

Copy to clipboard
preferences: main_shadow_end: {if $page eq "HomePage"}</div>{/if} main_shadow_start: {if $page eq "HomePage"}<div class="home">{/if} ...


When I change it to the multiline syntax (notice the "|" character and new indented line):

Copy to clipboard
preferences: main_shadow_end: | {if $page eq "HomePage"}</div>{/if} main_shadow_start: | {if $page eq "HomePage"}<div class="home">{/if} ...

then it works with no fatal error anymore!

What can we do to fix this? Fix the YAML exporter somehow to detect if there are any operands like > or < and if yes export the preference value as multiline even when it is just one line of text?

Anything else?

Thanks for your time reviewing this bug.
luci

Priority
25
Demonstrate Bug on Tiki 19+
Please demonstrate your bug on show2.tiki.org
Demonstrate Bug (older Tiki versions)
Ticket ID
6141
Created
Wednesday 19 October, 2016 14:08:45 UTC
by luci
LastModif
Wednesday 19 October, 2016 14:08:45 UTC


Collapse/expand modules below
Show PHP error messages