Empty field value in symbol properties triggers automatic deletion of the field entry

Description

Library symbol properties in Symbol Editor can NOT store fields with empty "Value" column, that is a very inconvenient problem.

As an example, if a field named "Variant" (required for KiBOM or similar BOM tools) is added to the Symbol Fields list, one should be able to leave the "Value" column empty inside the library, as a placeholder. After being placed in the schema, one can decide to edit the "Value" column matching the "Variant" field to control the loading of a specific part.

I don't see any reason why an empty "Value" field would trigger the application into kicking the field out from the properties of that symbol, the ".lib" has no problem storing them and the Symbol Editor has no problem to display them.

So why is the application removing those?

Steps to reproduce

  1. Inside the Symbol Edit application, load a library. Expand it to show all the symbols.
  2. Click a symbol, add a field:
  • Name = "Test Field"
  • Value = (leave empty)
  1. Save the symbol/library. Quit Symbol Editor and quit KiCad.
  2. Re-open KiCad, re-open Symbol Editor.
  3. Browse to the previously edited part and look for the "Test Field" entry: it is not there anymore...

KiCad Version

Application: KiCad
Version: 5.1.5-52549c5~86~ubuntu18.04.1, release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.16.18-galliumos x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
    Boost: 1.65.1
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.58.0
    Compiler: GCC 7.5.0 with C++ ABI 1011

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=ON
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON