`singletitle`/`uniquetitle`/`uniquework` only ignore entries whose `options` field contains the literal token `skipbib`; `skipbib=true` and `dataonly` still count

Open Beginner friendly
#545 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
latex, perl
Domain
backend

Research direction

The check lives in process_workuniqueness in lib/Biber.pm, which currently matches the literal string skipbib in the raw options field. Replace it with a lookup of the processed skipbib option via Biber::Config->getblxoption, then reproduce with the six-entry test.bib and the authoryear singletitle=true document from the issue. Done when entries a, c and e all get \true{singletitle}, and the t/ test suite still passes.

Written by the indexing model from the issue text.

Description

🤖 This issue was identified by Claude Opus 5.5, and the text below is entirely written by Claude Opus 5.5

process_workuniqueness leaves entries that are not in the bibliography out of the work-uniqueness counts, but it recognises them by looking for the exact string skipbib in the raw options field. (The check was added for #496, and related-entry clones work.) Equivalent spellings are missed:

@book{a, author={Smith, John}, title={T1}, year={2000}}
@book{b, author={Smith, John}, title={T2}, year={2001}, options={skipbib}}
@book{c, author={Jones, Bob},  title={T3}, year={2000}}
@book{d, author={Jones, Bob},  title={T4}, year={2001}, options={skipbib=true}}
@book{e, author={Brown, Al},   title={T5}, year={2000}}
@book{f, author={Brown, Al},   title={T6}, year={2001}, options={dataonly}}
\documentclass{article}
\usepackage[style=authoryear,singletitle=true]{biblatex}
\addbibresource{test.bib}
\begin{document}
\cite{a,b,c,d,e,f}
\printbibliography
\end{document}

biber 2.22 and current dev (79a1edc) give \true{singletitle} to a only. c and e are in exactly the same situation (one bibliography work by the author, plus one entry that is not printed), but d (skipbib=true) and f (dataonly, which implies skipbib) are counted, so c and e lose singletitle. The same check guards uniquetitle, uniquebaretitle and uniquework.

Suggested fix

Use the processed per-entry option instead of the raw field. This also covers set members, which get skipbib from process_sets:

--- a/lib/Biber.pm
+++ b/lib/Biber.pm
@@ -2199,11 +2199,10 @@
   # ignore settings from inheritance data?
   my $ignore = Biber::Config->get_uniq_ignore($citekey);
 
-  # If this is a data clone with skipbib set, don't record uniqueness info
-  if (my $options = $be->get_field('options')) {
-    if (grep {$_ eq 'skipbib'} $options->@*) {
-      return;
-    }
+  # Entries not in the bibliography (skipbib in any form, dataonly, set members)
+  # don't take part in work uniqueness
+  if (Biber::Config->getblxoption($secnum, 'skipbib', undef, $citekey)) {
+    return;
   }
 
   # singletitle

With this change a, c and e all get \true{singletitle}. All tests in t/ pass on dev (79a1edc) with this patch, applied together with the others I'm filing alongside it.

Dominant language
TeX
Stars
396
Forks
40
Avg merge
8h 3m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plk/biber

All issues in plk/biber

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.