Repository navigation
Augment a shared term handle through the replicator set that owns the term - #1565
Merged
Merged
Conversation
- Two replicator sets on `people` store a term under `activity`: a degree row (`credentials`) and a certification row (`certifications`). The schema context picked the first single-item field, so a certification slug was augmented as a `credentials` term. - On `statamic/cms` 6.40.0 the bare-slug Blink key in `Terms::augment()` returned the term an earlier augment had cached, which hid the wrong choice. Since 6.43.0 (statamic/cms#15974) the key is taxonomy-qualified, so the lookup misses and the row's kind resolves to null. - Narrow same-handle candidates to those whose taxonomies hold the stored term before choosing by shape. Closes #1517. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Gate verdict: ready, merging at
|
This was referenced Nov 26, 2026
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.
Closes #1517.
An assessment-based certificate's Certification JSON-LD again leaves out its audit and expiration dates on
statamic/cms6.43.1. The schema context now augments a term stored under a handle shared by two replicator sets through the set whose taxonomy holds the term, rather than the first single-item field.The bug
Two replicator sets on
peoplestore a term underactivity: a degree row (taxonomies: [credentials]) and a certification row (taxonomies: [certifications]).selectTermsLikeBlueprintFieldForMergedValue()chose between same-handle fields by storage shape only, so a certification slug was augmented through the degree row's field, as acredentialsterm. Probed on 6.43.1: the certificate slug augmented with thecredentialsfield config and returnednull, whichCertificationRowKind::termKind()then received as an empty collection.The
statamic/cmschange that exposed itstatamic/cms#15974 (commit
92d484b83, first tagged in v6.43.0), "Cache term augmentation with taxonomy-qualified ID", insrc/Fieldtypes/Terms.php:Blink::has($key = 'terms-augment-'.$site.'-'.json_encode($values)), keyed by the bare slug.$key = 'terms-augment-'.$site.'-'.json_encode($this->convertAugmentationValuesToIds($values));, keyed bytaxonomy::slug.Under the bare-slug key, the wrong-field augment hit the term an earlier augment through the right field had cached, so the wrong choice was invisible. Under the qualified key it misses, queries
credentials::<slug>, and finds nothing. Confirmed on 6.43.1 by putting v6.40.0's key line back intovendor/statamic/cms/src/Fieldtypes/Terms.phpwith no site change: both tests passed (10 of 10), and failed again with the vendor file restored.git diff v6.43.1 v6.44.0is empty forsrc/Fieldtypes/Terms.php,src/Stache/Query/TermQueryBuilder.php,src/Fields/Value.phpandsrc/Taxonomies/.Approach
app/Services/SchemaTemplates/SchemaOutputService.php: newtermsLikeCandidatesHoldingStoredTerm()keeps, when there are two or more candidates and the stored value is a slug or qualified id (bare, in aValue, or first of a list), the candidates whose configured taxonomies hold that term (Term::find("<taxonomy>::<slug>")). A qualified id only matches its own taxonomy. A value that is already a term, or that no candidate holds, keeps every candidate, so the shape-based choice is unchanged there.tests/Feature/Services/SchemaTemplates/SchemaOutputServiceTermsLikeTest.php: an eight-row dataset for the degree/certificationactivitypair. The two field doubles there and inSchemaOutputServiceGuardsTest.phpnow answerget('taxonomies').No
composer.jsonorcomposer.lockchange.Verification
Measured on Windows 11, PHP 8.4, in a worktree of this branch at
047f47862.statamic/cmsCertificationSchemaDatesJsonLdTest+CertificationNodeCountJsonLdTestmainreturn $candidates;), the five rows expecting the certification field fail and the three expecting the degree field pass; restored, 8 of 8 pass.SchemaOutputServiceTermsLikeTestandSchemaOutputServiceGuardsTest: 285 passed.tests/Feature/Certification*Test.phpandtests/Feature/Services/SchemaTemplates/SchemaOutputService*Test.phpfile (23 files) on 6.40.0, withvendor/bin/pest: 778 passed, 8 risky, 0 failed. The two edited test files report no risky test when run alone.composer stan, no errors), Rector dry run on the changedapp/file, cspell on the three files,check-mutate-ignore-breadthandcheck-parallel-safe-testspass.Companion PRs
patches-statamic-cmsv1.2.0 andstatamic/cms6.43.1 #1563 (Move to the patches-statamic-cms release that drops the Stache vanished-file patches #1250, the move to 6.43.1) is red on these two tests and waits on this one. Merge this first; Move topatches-statamic-cmsv1.2.0 andstatamic/cms6.43.1 #1563 then needsmainmerged in.Test plan
node scripts/ci-local.mjs --branch 1517-certification-term-overlay).