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
- Description
While working on a profile with exported preferences from
tiki-admin.php?page=profiles&cookietab=2I have realized when trying to apply that YAML code as a local profile using the following command:php console.php profile:apply my-preferences profilesthe result is fatal error:
Copy to clipboardPHP 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 asmy-preferences.ymlin aprofiles/dir) contains one line preferences like this:Copy to clipboardpreferences: 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 clipboardpreferences: 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+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 6141
- Created
- Wednesday 19 October, 2016 14:08:45 UTC
by luci - LastModif
- Wednesday 19 October, 2016 14:08:45 UTC