- This topic has 7 replies, 3 voices, and was last updated 8 years, 6 months ago by
kiwi.
Tags: reports
-
19th May 2015 at 10:15 am #4412
Not used reports for ages but just now tried them with 3.0.0 and get errors:
ERROR 2: sprintf(): Too few arguments
followed by various lines of details depending on which report selected -
19th May 2015 at 12:25 pm #4413
I think that’s a bug in the “Ancestors” report texts. Can you disable just that report [Admin > Modules > Manage modules > Ancestors] and let me know if the error disappears?Nigel
My personal kiwitrees site is www.our-families.info -
19th May 2015 at 2:29 pm #4414
Sorry, ignore first reply. I’m pretty sure I’ve found the problem.
Try replacing the file /includes/reportheader.php with the version in the attached zip folder.
Nigel
My personal kiwitrees site is www.our-families.info -
19th May 2015 at 10:47 pm #4416
It should be noted that the problem appears to be for the PDF report versions. The HTML output works; at least on the ones that I have tried.
Roy
Apache 2.4.27 PHP 7.19 MariaDB 10.2.8
-
20th May 2015 at 1:58 am #4417
The problem is still there.
It only appears for reports: Ancestors, births, cemeteries, deaths, missing data, occupations, related indis, sources, and vital records. And it appears immediately, ie. before selecting whether PDF or HTMLAncestors and sources produce mostt errors
-
20th May 2015 at 6:22 pm #4419
OK. Thanks for the feedback. The ‘fix’ I provided was a start, but it missed the real issue, and also introduced a new one, so please delete that and revert to the original file (I can supply a copy of that if you need it).
The ‘real’ issue was surprisingly in the en_GB.mo translation file.
Please try the attached version.
Remember to go to Admin > Site Administration > Clean up data folder and delete the “cache’ folder completely. Then return to and refresh the Reports pages. I’ve tested most of them and they are working OK for me, but it is still possible I missed one.
Nigel
My personal kiwitrees site is www.our-families.info -
21st May 2015 at 10:25 am #4421
Thanks, they all seem OK. What a strange dependency!
-
21st May 2015 at 10:44 am #4422
What a strange dependency!
Actually not so strange once I thought it through carefully.
In our translations we often embed variables for things like number counts. For example, there is a phrase “Total individuals: xxx” where xxx is a number. The translatable text is therefore WT_I18N::translate(‘Total individuals: %s’, $count_indis) . Here the result of the calculated variable $count_indis is inserted in the text at the position of ‘%s’. Doing it like this ensures any language can work with the same variable even if its position in the sentence needs to change. But it is essential that ALL languages include the ‘%s” variable. In the en_GB file the ‘%s’ variable had been accidentally missed from the translation. Hence the error message “Too few arguments”. It was looking for the variable in the translation and it wan’t there.
Nigel
My personal kiwitrees site is www.our-families.info
- The topic ‘Reports’ is closed to new replies.