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.


Details
This PR addresses two issues related to material handling in steps:
step.blade.phpview now distinguishes between intentionally text-only steps (wherematerial_typeis null) and steps where material was deleted (wherematerial_typeis set but the material record is missing). An error message is now displayed when material is missing but amaterial_typewas specified.MorphToSelectWithCreatecomponent now usesrequiredWith('material_type')for thematerial_idfield. This prevents users from selecting amaterial_typewithout also selecting an actual material item, ensuring data consistency.Note
Low Risk
Low risk: view logic and form validation tweaks to prevent inconsistent step/material states; main risk is stricter validation blocking previously-saved partial entries.
Overview
Improves step material consistency by treating
material_type = nullas an intentionally text-only step (shows only the next button) while showing an explicit error state whenmaterial_typeis set but the linked material record is missing.Tightens the step material form by making
material_idrequiredWith('material_type'), preventing users from selecting a material type without choosing an actual material.Written by Cursor Bugbot for commit d2b7e39. This will update automatically on new commits. Configure here.