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

Ensure we save the modified title and use that when we insert a title #509

Merged
merged 2 commits into from
Jun 27, 2023

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Jun 26, 2023

Description of the Change

As described in #508, any edits made to generated titles before they are inserted don't persist. The problem lies in how we save edited titles and which title we use when inserting. Basically we weren't saving the edited title to state and we were using the raw generated title when inserting.

This PR changes both to ensure any edits made persist to our state object and then we use the state object when a title is inserted.

Closes #508

How to test the Change

  1. Ensure the Title Generation feature is on
  2. Generate titles for a piece of content
  3. Choose one of those titles, don't make any edits and then select it
  4. Ensure the title of your content updates correctly
  5. Generate titles again and this time edit one of the titles
  6. Select to use the edited title and ensure the title of your content updates correctly with those edits

Changelog Entry

Fixed - Ensure any edits made to generated titles persist when inserting said title

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 2.2.2 milestone Jun 26, 2023
@dkotter dkotter requested a review from a team as a code owner June 26, 2023 16:43
@dkotter dkotter self-assigned this Jun 26, 2023
@dkotter dkotter requested a review from jeffpaul as a code owner June 26, 2023 16:43
@dkotter dkotter requested review from a team and Sidsector9 and removed request for a team and jeffpaul June 26, 2023 16:43
@dkotter dkotter requested review from ravinderk and removed request for Sidsector9 June 26, 2023 19:18
@@ -17,7 +17,6 @@ jobs:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer note: removing this from our test matrix for now as it's causing tests to fail due to 10up/cypress-wp-utils#98

Copy link
Member

@Sidsector9 Sidsector9 left a comment

Choose a reason for hiding this comment

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

Tested and works well 👍

@dkotter dkotter merged commit a3fd3ad into develop Jun 27, 2023
@dkotter dkotter deleted the fix/508 branch June 27, 2023 15:29
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.

Edits made to generated titles don't persist
2 participants