Skip to content

Comments

Fix batch validation when there are only warnings#9181

Open
tylerjmchugh wants to merge 1 commit intogeonetwork:mainfrom
tylerjmchugh:fix-batch-validation-warnings
Open

Fix batch validation when there are only warnings#9181
tylerjmchugh wants to merge 1 commit intogeonetwork:mainfrom
tylerjmchugh:fix-batch-validation-warnings

Conversation

@tylerjmchugh
Copy link
Contributor

@tylerjmchugh tylerjmchugh commented Feb 19, 2026

Currently if you run batch validation on a selection of records with only validation warnings the UI and json response is incorrect:

image
{  
    "uuid": "e02c689f-202a-450b-bbdf-32cebe2f4845",  
    "metadata": [  
        201646  
    ],  
    "validMetadata": {},  
    "invalidMetadata": {  
        "201646": {  
            "message": "Is invalid",  
            "uuid": "3cc1c921-152b-4b8f-81b4-ebb1b13a3f53",  
            "draft": false,  
            "approved": true,  
            "date": "2026-02-03T12:47:19.861402Z"  
        }  
    },  
    "metadataWithWarnings": {  
        "201646": {  
            "message": "Has warnings",  
            "uuid": "3cc1c921-152b-4b8f-81b4-ebb1b13a3f53",  
            "draft": false,  
            "approved": true,  
            "date": "2026-02-03T12:47:19.857906Z"  
        }  
    },  
    "validationErrors": {},  
    "validationWarnings": {  
        "201646": [  
            {  
                "schematron": "schematron-rules-resource-content",  
                "messages": {  
                    "sample.pdf": [  
                        "Content must either be tagged as structural content or explicitly marked as an artifact so assistive technology can skip it"  
                    ]  
                }  
            }  
        ]  
    },  
    "numberOfRecords": 1,  
    "numberOfRecordsProcessed": 1,  
    "numberOfValidRecords": 0,  
    "numberOfInvalidRecords": 1,  
    "numberOfRecordsWithValidationWarnings": 1,  
    "numberOfNullRecords": 0,  
    "numberOfRecordsNotEditable": 0,  
    "startIsoDateTime": "2026-02-03T12:47:18.3719Z",  
    "endIsoDateTime": "2026-02-03T12:47:20.376935Z",  
    "ellapsedTimeInSeconds": 2,  
    "totalTimeInSeconds": 2,  
    "running": false,  
    "type": "MetadataValidationProcessingReport"  
}

This occurs because the current isValid property is set to true if any schematron (even report only schematrons) has failed asserts.

This PR aims to fix this issue by correctly setting the record as valid when there are only warnings.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@tylerjmchugh tylerjmchugh changed the title Fix batch validation UI when there are only warnings Fix batch validation when there are only warnings Feb 19, 2026
@ianwallen ianwallen added the bug label Feb 19, 2026
@ianwallen ianwallen added this to the 4.4.10 milestone Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants