Skip to content

[8592] Send field to serializers for datasources in TB2#4836

Merged
rart merged 2 commits intocraftercms:developfrom
jvega190:bugfix/8592
Apr 1, 2026
Merged

[8592] Send field to serializers for datasources in TB2#4836
rart merged 2 commits intocraftercms:developfrom
jvega190:bugfix/8592

Conversation

@jvega190
Copy link
Copy Markdown
Member

@jvega190 jvega190 commented Mar 26, 2026

craftercms/craftercms#8592

Summary by CodeRabbit

  • Bug Fixes
    • Fixed data type handling during content type updates to ensure descriptor fields are properly processed for accurate value serialization.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

Walkthrough

Modified updateTypeFromDataSourceUpdate function to pass the descriptor field object to value serialization, replacing the previous serializer(null, value) call with serializer(field, value) by retrieving the field from descriptorFields.

Changes

Cohort / File(s) Summary
Serialization Bug Fix
ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx
Updated value serialization to pass the descriptor field object instead of null, enabling serializers to access field type information during datasource value processing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • Fix datasources form in TB2 craftercms#8592: Addresses the same bug where serializers were called without the descriptor field for datasource values; this PR implements the fix by passing the descriptor field into the serializer function.

Suggested reviewers

  • rart
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only contains a link to the GitHub issue without providing any substantive details about the changes, implementation, or rationale. Expand the description to explain what the bug was, how the fix addresses it, and any relevant testing or side effects beyond just linking the issue.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: passing field objects to serializers for datasources in TB2, which matches the implementation that retrieves descriptorFields and passes the field to serializer functions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jvega190 jvega190 marked this pull request as ready for review March 26, 2026 21:47
@jvega190 jvega190 requested a review from rart as a code owner March 26, 2026 21:47
@jvega190 jvega190 changed the title [8592] Fix datasources form in TB2 [8592] Send field to serializers for datasources in TB2 Mar 27, 2026
@rart rart merged commit e807e74 into craftercms:develop Apr 1, 2026
3 of 4 checks passed
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.

2 participants