Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category - The "Type" field is missing after saving an unfilled form #14168 #14445

Open
wants to merge 2 commits into
base: 5.2
Choose a base branch
from

Conversation

levente999
Copy link

@levente999 levente999 commented Jan 9, 2025

Q A
Bug fix? (use the a.b branch) 🟢
New feature/enhancement? (use the a.x branch) 🔴
Deprecations? 🔴
BC breaks? (use the c.x branch) 🔴
Automated tests included? 🔴

Description

Fixes #14168

This PR resolves an issue where the Type field disappears from the "New Category" form after clicking the "Save" button without filling out other fields (e.g., Title, Description, Alias, and Color). The fix ensures that the Type field remains visible and persists regardless of form validation failures.

See https://monosnap.com/file/PfAT6BW5tV3ueo8da0QBhfuqtXv3sq


📋 Steps to test this PR:

Step 1: Install Mautic
Step 2: Input valid credentials
Step 3: Click on the "Login" button
Step 4: Click on the Settings icon at the top right of the screen
Step 5: Click on Categories
Step 6: Click on the "New" button
Step 7: Leave the Title, Description, Alias, and Color fields blank
Step 8: Click on the "Save" button
Step 9: Still appeared the "Type" field

@RCheesley
Copy link
Member

Please check the failing test @levente999 - thanks!

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.44%. Comparing base (601ab50) to head (e3f1ee9).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                5.2   #14445      +/-   ##
============================================
- Coverage     63.45%   63.44%   -0.01%     
  Complexity    34633    34633              
============================================
  Files          2273     2273              
  Lines        103596   103596              
============================================
- Hits          65732    65730       -2     
- Misses        37864    37866       +2     
Files with missing lines Coverage Δ
...s/CategoryBundle/Controller/CategoryController.php 50.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@escopecz escopecz added bug Issues or PR's relating to bugs categories Anything related to categories needs-automated-tests PR's that need automated tests before they can be merged labels Jan 9, 2025
@escopecz escopecz added this to the 5.2.2 milestone Jan 9, 2025
@escopecz escopecz self-requested a review January 9, 2025 13:32
@escopecz
Copy link
Member

escopecz commented Jan 9, 2025

This change shows the field where it shouldn't now as the bundle is known when creating the category for example from the segment edit form, it's obvious that it should be for segments:

Screen.Recording.2025-01-09.at.14.35.42.mov

And please, cover the change with functional tests that will make sure it won't get broken in the future.

@escopecz escopecz added the pending-feedback PR's and issues that are awaiting feedback from the author label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs categories Anything related to categories needs-automated-tests PR's that need automated tests before they can be merged pending-feedback PR's and issues that are awaiting feedback from the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants