Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Don't allow saving if there's no pattern title, or if it's a duplicate #67

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented Feb 21, 2023

Jen found there's a PHP error if you save a pattern with no title.

And Michael suggested the client side block saving if there's no title or if it's a duplicate.

So this PR does that.

Fixes part of #57 (Deleting title on the edit screen, then saving results in a php error)

How to test

  1. Create a new pattern
  2. Add some content
  3. Remove the title
  4. Expected: The 'Update Pattern' button is disabled:

Screenshot 2023-02-21 at 12 39 54 PM

  1. Add a title
  2. Expected: The 'Update Pattern' button isn't disabled: Screenshot 2023-02-21 at 12 40 04 PM

Copy link
Contributor

@dreamwhisper dreamwhisper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@kienstra
Copy link
Contributor Author

Thanks a lot, @dreamwhisper!

@kienstra kienstra merged commit a900ba9 into main Feb 21, 2023
@kienstra kienstra deleted the fix/php-error-no-title branch February 21, 2023 22:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants