Created attachment 373929 [details] Report Error on MacOS Catalina Two similar error reports generated by two different users. (see attached) Steps to reproduce: 1. Run a Consolidate Transaction Report 2. Select account(s) to report on in the Accounts tab 3. Select the option 'Consolidate Transactions' in the Display tab
Created attachment 373930 [details] Report Error on Win10
I forgot to add, I don't see the option in this report to not make account names URLs. Perhaps if that were added/turned off, this might not be an issue. (till it gets fixed properly)
I may be missing some thing, but I can not find that report in the menus and can not find the file 'consolidate-transactions.scm'. Was this written by a third party file?
(In reply to Bob from comment #3) > I may be missing some thing, but I can not find that report in the menus and > can not find the file 'consolidate-transactions.scm'. > > Was this written by a third party file? Correct, by Doug Doughty around 2017 and are extremely buggy.
Obvious from the location of the scheme file raising the error: $GNUCASH_DATA_HOME/custom-reports. Looks to me like it can be fixed simply by adding (use-modules gnucash html) before the gnc-build-url call, though that might expose one or more later include-what-you-use failures. Chris's recent guile-3 driven massive fix [1] of those issues added 8 use-modules calls to html-utilities.scm, the main Scheme file in GnuCash that uses gnc-build-url. That said, it worked at some point so we've apparently managed to break user code. Chris, any ideas on the cause and what we can do to at least warn users with custom code? [1] https://github.com/Gnucash/gnucash/pull/831/files#diff-fbeb66428cd2891229fe45e1e08f3b4ae0497e779d595c2a0349e45e6b8d6453
Oops. Sorry for reporting a bug on a custom report. I tried John's suggestion by adding (use-modules gnucash html) but it is still throwing the same error. I'll chuck this one in my 'no longer works' folder of custom reports till I can get around to figuring it out.
I don't think the modularisation is crucial -- modularisation aims to silence warnings (because warnings eventually lead to broken code). I think it's simply bitrot. I think this bug comes from gnc:module-load deprecations. Perhaps attach the relevant files and we can have a look.
Created attachment 373931 [details] Consolidate Transaction Report This report requires a custom gnctimeperiod-utilities.scm also attached.
Created attachment 373932 [details] Custom gnctimeperiod-utilities
I think the right fix is "(use-modules (gnucash html))"
Indeed, sorry I didn't catch that myself. Thanks, it works!
Not quite. The fix may work but the real bug is in gnc:module-load which gjanssens wrote and mishandles (gnc:module-load "gnucash/html") The real 4.x fix is as follows, which gives appropriate hints. modified bindings/guile/gnc-module.scm @@ -64,7 +64,7 @@ this module in your code or not.") been deprecated. Use '(use-modules (" mod-name-str "))' instead.") (module-use! (current-module) (resolve-interface scm-mod-name))) - ((or "gnucash/gnome-utils" "gnucash/html" "gnucash/report/report-system") + ((or "gnucash/gnome-utils" "gnucash/report/report-system") (when (string=? gnc-mod-name "gnucash/report/report-system") (set! mod-name-str "gnucash report")) (set! scm-mod-name '(gnucash report)) @@ -76,6 +76,12 @@ or not you use functions from this module in your code or not.") (use-modules (gnucash engine) (gnucash app-utils)) (module-use! (current-module) (resolve-interface scm-mod-name))) + ("gnucash/html" + (deprecate "* WARNING * '(gnc:module-load \"gnucash/html\" 0)' has \ +been deprecated. Use '(use-modules (gnucash html))' instead.") + (use-modules (gnucash html)) + (module-use! (current-module) (resolve-interface scm-mod-name))) + (_ (deprecate "* WARNING * '(gnc:module-load \"" gnc-mod-name "\" 0)' \ has been deprecated. Use '(use-modules (" mod-name-str "))' instead. \ Additional guile modules may have to be loaded depending on your specific code.")
Roger that. Thanks again!