Skip to content

fix: keep literal placeholder values with datatypes other than date/dateTime - #565

Merged
tkuhn merged 1 commit into
masterfrom
fix/literal-placeholder-datatypes
Jul 27, 2026
Merged

fix: keep literal placeholder values with datatypes other than date/dateTime#565
tkuhn merged 1 commit into
masterfrom
fix/literal-placeholder-datatypes

Conversation

@tkuhn

@tkuhn tkuhn commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #564.

Problem

A nt:LiteralPlaceholder with a datatype other than xsd:date/xsd:dateTime (e.g. nt:hasDatatype xsd:gYear) always failed on publish/preview with "Field of statement not set.", even with the field filled in: the datatyped branch of TemplateContext.processValue() only handled xsd:dateTime and xsd:date and left processedValue as null for everything else, so StatementItem.hasEmptyElements() treated the filled field as unset.

Fix

Restructured the isLiteralPlaceholder branch so xsd:dateTime and xsd:date keep their special component-model handling, and every other case (including other datatypes) falls through to the textfield path. The previously dead if (datatype != null) there now becomes live and produces vf.createLiteral(tfObject, datatype).

Tests

New LiteralPlaceholderDatatypeTest covers xsd:gYear and xsd:integer typed literals, plain literals, language-tagged literals, and the empty-value case. Full suite passes (799 tests, 0 failures).

🤖 Generated with Claude Code

…ateTime

A nt:LiteralPlaceholder with a datatype like xsd:gYear silently dropped
the entered value in TemplateContext.processValue, because the datatyped
branch only handled xsd:dateTime and xsd:date. Non-optional statements
then failed on publish with "Field of statement not set." even though
the field was filled in. Other datatypes now take the textfield path and
produce a typed literal.

Fixes #564

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tkuhn
tkuhn merged commit cd7803f into master Jul 27, 2026
8 checks passed
@tkuhn
tkuhn deleted the fix/literal-placeholder-datatypes branch July 27, 2026 11:15
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.

Literal placeholders with datatypes other than xsd:date/xsd:dateTime lose their value, causing "Field of statement not set."

1 participant