[Custom Reports]: Make element_type and element_class_id optional in CsvCreationHandler#1773
Merged
martineiber merged 1 commit into2025.4from Apr 23, 2026
Merged
Conversation
…n CsvCreationHandler
|
Not up to standards ⛔
|
lukmzig
approved these changes
Apr 23, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Problem
The custom report CSV export fails with:
CsvCreationHandlerusesExportCreationHandlerSetupTraitwhich markselement_type,element_class_id, andcolumnsas required step config fields. This is correct for element grid exports (assets, data-objects), but the custom report flow reuses the sameCsvCreationMessage/CsvCreationHandlerwithout those fields — custom reports are not tied to any element type, so the collection step pre-builds all CSV data itself.Fix
ExportCreationHandlerSetupTraitfromCsvCreationHandlerand overrideconfigureStepdirectly: onlyCONFIG_CONFIGURATIONandCONFIG_COLUMNSremain required (with empty-array defaults);ELEMENT_TYPEandELEMENT_CLASS_IDbecome optional withnulldefaults.extractOptionalConfigFieldFromJobStepConfighelper toAbstractHandlerfor safe extraction with a default value.CsvCreationHandlerto use the optional extractor forelement_typeandelement_class_id.The existing element-grid CSV export flow is unaffected — it still provides all fields, they are just no longer enforced at the step-config validation level.