eeschema - 'symbol fields'-editor - linebreak in a component field makes schematic unreadable

Bug #1842943 reported by Otto Mikkonen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Jeff Young

Bug Description

When working with the new 'symbol fields'-editor in eeschema, I've experienced a breakage of the associated .sch-file due to linebreaks appearing on one of the component-fields.

I'm not exactly sure from where these linebreaks appear, but they somehow make their way into the fields when copying component field-data from one part to another. Somehow selecting a field graphically and copy-pasting it to another sometimes selects a hidden linebreak, which then partially breaks the associated .sch file. Could also be, that the linebreak originates from an external source, like the part# from mouser.com.

Anyways, since these linebreaks can be so disastrous, I thought some added resilience to how fields are managed would be neat. I.e., when linebreak is encountered on a component field, it could be filtered out before saving the .sch or something. I can't imagine a case, when linebreak is actually wanted on a component field.

I added a screenshot on how the error-messages might look like when trying to open up a broken schematic.

## VERSION INFO ##

Application: Eeschema
Version: 5.1.4-e60b266~84~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.15.0-60-generic 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.4.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

Revision history for this message
Otto Mikkonen (ottomaani138) wrote :
Revision history for this message
Otto Mikkonen (ottomaani138) wrote :

Here's how a broken line looks like ( line 1307 )

Revision history for this message
Otto Mikkonen (ottomaani138) wrote :

And here's how it can be fixed (again, line 1307)

Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Can you track down how the line break got inserted into the schematic file? Could it have been in a previous KiCad version? I recall a bug report where the fix involved stripping new lines from such fields: https://bugs.launchpad.net/kicad/+bug/1828214

Revision history for this message
Michael Kavanagh (michaelkavanagh) wrote :

Sorry, I misread. Sounds like the line break is inserted when copying a fields contents from one component (row) to another?

Revision history for this message
Otto Mikkonen (ottomaani138) wrote :

Hey Michael!
Correct, the line breaks are inserted when copying content from component rows to others!
Also, the bug report you referenced describes identical issues (.sch's breaking due to line breaks), although produced in a slightly different manner. Anyways, the proposed solution, as far as I can understand it ( ' It looks like we need some additional validators added to the field grid table in order to prevent this.' ) should have gotten rid of this issue as well? Although I'm already on 5.1.4 and the Fix should have been there already on 5.1.3.. Hmm..

Jeff Young (jeyjey)
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: New → In Progress
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision a612fb690bc08bf1215755772a0e04a447a541a6
https://git.launchpad.net/kicad/patch/?id=a612fb690bc08bf1215755772a0e04a447a541a6

Changed in kicad:
status: In Progress → Fix Committed
Jeff Young (jeyjey)
Changed in kicad:
milestone: none → 5.1.5
importance: Undecided → High
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.