• This topic has 7 replies, 3 voices, and was last updated 7 years ago by kiwikiwi.

Tags:

Viewing 8 posts - 1 through 8 (of 8 total)
Author
Posts
  • #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

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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
  • #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
  • #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

  • #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 HTML

    Ancestors and sources produce mostt errors

    Ancestors

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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
  • #4421

    Thanks, they all seem OK. What a strange dependency!

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Reports’ is closed to new replies.