New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't specify a family for family_descend_chart #334
Comments
Cross-ref... Thread on Discourse: |
Thanks! Makes perfect sense to me. Tagging @cdhorn as well who implemented reports.py. |
Yes, thanks and agree it makes sense. While I added the validation code there to try to sanity check things I clearly did not make time to test every option for every report. Can you create a PR for David to merge? |
I'm afraid I'm a GitHub newbie, so I'll need some help. I've cloned the repo, created a (local) branch, made the change in that branch, and committed it. I now have to push it. |
Hi, assuming your clone is git push -u origin fix_report That should do the trick and Github should automatically ask you if you want to open a PR. |
$ git push -u origin handle_colon_in_report_option Although the prompt is "Password", I'm using a "personal access token (classic)". |
Sorry, I missed that you wrote "I've cloned the repo" rather than "I've forked the repo". You can't push directly to this repo, you have to click the "fork" button first and then clone your fork rather than the original repo. |
Success! Thanks. PR #335 |
Thanks for the contribution! Fixed by #335. |
(If this looks familiar, it may be because I previously posted this on Gramps discourse.)
I have been trying to generate a “family_descend_chart” report.
I had trouble specifying which family to report on.
I tried: “pid”: “F0098” and got ERROR 422: UNPROCESSABLE ENTITY.
Looking into the code (reports.py), I found that option values are checked for validity against the command’s help text. In the case of “pid” (which probably ought to be “fid”; copy/paste error?), each of the valid values identifies a specific family as ID colon tab family-name; e.g. “F0137:\tDoe, John, Smith, Jane”
Having tried using that as the “pid” value (which didn’t work), I looked further and found that the help values are split at the tab, with only the part before the tab being used.
So I tried “F0098:” that is with a colon after the ID.
That successfully passed validation, but failed later on because, of course, there was no family with an ID of “F0098:”.
I tried changing the split on tab to a split on “:\t”, but of course that broke other options which don’t have a colon.
I worked round this by adding "rstrip(‘:’) to the split-on-tab result. That worked!
A simpler way would be not to use a colon in the help text, but I haven’t been able to find where that text is generated.
If you want to use the rstrip method, I've attached a patch file (against #312). Note that this also removes the unnecessary test for "\t" in item; if there's no tab, split will return a single element list with the original string in it.
reports.TXT
The text was updated successfully, but these errors were encountered: