After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627575 - Stylesheet names with non-alphanumeric characters and saved-reports
Stylesheet names with non-alphanumeric characters and saved-reports
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
git-master
Other Linux
: Normal normal
: ---
Assigned To: Andreas Köhler
Andreas Köhler
Depends on:
Blocks:
 
 
Reported: 2010-08-21 15:28 UTC by Geert Janssens
Modified: 2018-06-29 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Geert Janssens 2010-08-21 15:28:12 UTC
I have a stylesheet by the name of "Kobalt W.I.T."

This name contains a space and some periods. When I open a report I can use this stylesheet correctly.

However, when I save the report (or even simply leave it open and restart GnuCash), the stylesheet won't be loaded when I reopen the report in a later session.

Steps to reproduce:
1. Create a stylesheet that has a space and/or period in the name (I'm not sure which character causes this bug exactly, although I suspect it's the space)
2. Open a report and use the new stylesheet
3. Leave the report open and restart GnuCash

=> The report will be loaded on startup, but it uses the default stylesheet now.

4. Edit the report, set the stylesheet back to the newly created one and set a different name.
5. Save the report and close it
6. Restart GnuCash and load the report from the Custom Reports menu

=> The report will be loaded with the default stylesheet
Comment 1 Bob 2011-09-28 14:47:47 UTC
Came across this today while checking my Builder changes for reports.

If I have a space in the title of my new stylesheet like "My One", in the saved-reports-2.4 file you end up with this....

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Stylesheet")))
  ((lambda (option) (if option ((gnc:option-setter option) '#{My\ One}#))) option))


and as such this does not load. If I change the title to "My-One" all works OK so it look like spaces are a problem and this is what is saved.

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Stylesheet")))
  ((lambda (option) (if option ((gnc:option-setter option) 'My-One))) option))
Comment 2 Geert Janssens 2013-12-07 10:30:28 UTC
Finally figured this one out:
g_key_file_[gs]et_string parses the string to escape newlines and comments before writing it to the gnucash metadata file. This erroneously does some escaping in the #{symbol name}# guile extended format for symbols.

Since we already strip newlines and comments ourselves, we can save and store the string without any additional parsing using g_key_file_[gs]et_value.

Commit r23499 (development branch) and r23500 (2.4 branch).
Comment 3 Geert Janssens 2013-12-07 16:19:37 UTC
Hmm, just discovered that the fix only works properly with guile 2. There seems to be a bug in guile 1.8 preventing this from working properly.

I have committed a workaround in r23501 (development branch) and r23508 (2.4 branch) to deal with this.
Comment 4 John Ralls 2018-06-29 22:43:32 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=627575. Please update any external references or bookmarks.