Skip to content

ImportMerge: fix crash when adding/merging Tag objects (bug 0014056) - #5

Merged
eduralph merged 1 commit into
maintenance/gramps60from
fix/importmerge-tag-gramps-id-14056
Apr 17, 2026
Merged

ImportMerge: fix crash when adding/merging Tag objects (bug 0014056)#5
eduralph merged 1 commit into
maintenance/gramps60from
fix/importmerge-tag-gramps-id-14056

Conversation

@eduralph

Copy link
Copy Markdown
Owner

Summary

  • Fix 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 no gramps_id, so the generic has_<type>_gramps_id / find_next_<type>_gramps_id lookups in do_commits fail. Both the S_ADD and S_DIFFERS GID-conflict blocks now skip Tag.
  • Bump plugin version 0.0.25 → 0.0.26.
  • Add regression tests covering both code paths. Tests fail without the guard with the exact AttributeError from 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 fix
  • Reverted fix via git stash, re-ran: both tests fail with AttributeError: 'Tag' object has no attribute 'gramps_id' (matches reporter's trace)
  • python3 AST parse of all touched files
  • CI: lint, compile-check, unit-test (Linux + Windows), integration-test, build

🤖 Generated with Claude Code

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>
@eduralph
eduralph merged commit 4f0d7ba into maintenance/gramps60 Apr 17, 2026
7 checks passed
@eduralph
eduralph deleted the fix/importmerge-tag-gramps-id-14056 branch May 26, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant