ImportMerge: fix crash when adding/merging Tag objects (bug 0014056) - #5
Merged
eduralph merged 1 commit intoApr 17, 2026
Merged
Conversation
Tag is a table object without a gramps_id field, so the generic has_<obj_type>_gramps_id / find_next_<obj_type>_gramps_id lookups in do_commits raised AttributeError when the user selected Add on a Tag row. Guard both the S_ADD and S_DIFFERS GID-conflict blocks so they skip Tag. Adds integration tests covering both branches; verified they fail without the guard and pass with it. Fixes bug 0014056 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AttributeError: 'SQLite' object has no attribute 'has_tag_gramps_id'in the Import Merge tool when the user selects Add (or encounters a differing Tag) on a Tag row. Tag is a table object with nogramps_id, so the generichas_<type>_gramps_id/find_next_<type>_gramps_idlookups indo_commitsfail. Both theS_ADDandS_DIFFERSGID-conflict blocks now skip Tag.AttributeErrorfrom the bug report and pass with it.Fixes upstream bug 0014056.
Test plan
docker run --rm -v "$(pwd)":/workspace gramps-ci python3 -m pytest ImportMerge/tests/ -v— both tests pass with fixgit stash, re-ran: both tests fail withAttributeError: 'Tag' object has no attribute 'gramps_id'(matches reporter's trace)python3AST parse of all touched files🤖 Generated with Claude Code