mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Don't load a custom report that has the same name as a standard
report. Fixes #168250. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13877 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2006-04-29 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/report/report-system/report.scm: Don't load a custom report
|
||||
that has the same name as a standard report. Fixes #168250.
|
||||
|
||||
* src/bin/gnucash-bin.c: Load the user config earlier in startup.
|
||||
Fixes the missing custom report problem #338668.
|
||||
|
||||
|
||||
@@ -92,14 +92,23 @@
|
||||
(let ((report-rec (args-to-defn #f args)))
|
||||
(if (and report-rec
|
||||
(gnc:report-template-name report-rec))
|
||||
(hash-set! *gnc:_report-templates_*
|
||||
(gnc:report-template-name report-rec) report-rec)
|
||||
(let* ((name (gnc:report-template-name report-rec))
|
||||
(tmpl (hash-ref *gnc:_report-templates_* name)))
|
||||
(if (not tmpl)
|
||||
(hash-set! *gnc:_report-templates_*
|
||||
(gnc:report-template-name report-rec) report-rec)
|
||||
(begin
|
||||
(gnc:error (_ "Refusing to add custom report with the same name as an existing report."))
|
||||
(gnc:error (_ "Please edit your saved-reports file and delete the section for: ") name)
|
||||
)))
|
||||
(gnc:warn "gnc:define-report: bad report"))))
|
||||
|
||||
(define gnc:report-template-version
|
||||
(record-accessor <report-template> 'version))
|
||||
(define gnc:report-template-name
|
||||
(record-accessor <report-template> 'name))
|
||||
(define gnc:report-template-set-name
|
||||
(record-modifier <report-template> 'name))
|
||||
(define gnc:report-template-options-generator
|
||||
(record-accessor <report-template> 'options-generator))
|
||||
(define gnc:report-template-options-cleanup-cb
|
||||
|
||||
Reference in New Issue
Block a user