Problem/Motivation

_bs_base_set_yml_value() function is buggy and it will fail in a case when root variable partially exists in yaml file. It should update the variable but currently, it will just add a new version and produce invalid yaml file.

Comments

pivica created an issue. See original summary.

pivica’s picture

Status: Active » Needs review
Issue tags: +next-release
StatusFileSize
new2.57 KB

Here is a patch.

sasanikolic’s picture

Tested and works as expected with the patch.

pivica’s picture

StatusFileSize
new883 bytes
new2.77 KB

While debugging another issue i found out that regexp is not catching all possible variations, here is a new patch.

pivica’s picture

StatusFileSize
new642 bytes
new642 bytes

And now i figure it that / delimiter is not good because it's in path also, lets try #.

pivica’s picture

StatusFileSize
new3.27 KB

The wrong patch attached in last comment, here is correct one.

pivica’s picture

StatusFileSize
new1.44 KB
new3.83 KB

Improved comment a bit and added exception throwing if you try to use anything else then primitive values.

  • pivica committed c6ef619 on 8.x-1.x
    Issue #3068227 by pivica: Improve _bs_base_set_yml_value() so it can...
pivica’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.