Skip to content

Save page info to PostRepository when creating a new page from Layout picker#14141

Merged
cameronvoell merged 2 commits intodevelopfrom
fix/gutenberg-2701-changes-detected-new-page-template
Feb 26, 2021
Merged

Save page info to PostRepository when creating a new page from Layout picker#14141
cameronvoell merged 2 commits intodevelopfrom
fix/gutenberg-2701-changes-detected-new-page-template

Conversation

@cameronvoell
Copy link
Copy Markdown
Contributor

Fixes wordpress-mobile/gutenberg-mobile#2701

To test:

  1. Run the WPApp in DEBUG mode from the PR above.
  2. In the My Site screen press the Add(+) floating button
  3. Select Site page from the bottom menu
  4. Scroll to the bottom and select the first layout of the Contact pages category
  5. Press the Create page button
  6. Wait for the page to load
  7. Press the back button without editing the page
  8. Notice that the app no longer crashes

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 24, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@cameronvoell cameronvoell changed the title Save page info to local db when creating a new page from Layout picker Save page info to PostRepository when creating a new page from Layout picker Feb 24, 2021
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 24, 2021

You can test the changes on this Pull Request by downloading the APK here.

@cameronvoell cameronvoell requested a review from antonis February 24, 2021 17:06
@cameronvoell cameronvoell marked this pull request as ready for review February 24, 2021 17:06
@peril-wordpress-mobile
Copy link
Copy Markdown

Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@cameronvoell
Copy link
Copy Markdown
Contributor Author

Note that this PR fixes one case of this issue: #13003, but I do not expect it to fix all cases (some Sentry events are for posts not pages).

mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST);
}

private void newPageFromLayoutPickerSetup(String title, String content) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can probably reuse the implementation of newPostSetup since the only difference is the instantiatePostModel call.
This is just a suggestion and I understand that the way that it is implemented now might be more clear and easier to extend in the future.

Copy link
Copy Markdown
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

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

Great work tracking down this issue and fixing it @cameronvoell 👍
I tested this on a Google Pixel 2 XL with Android 11 and works as expected. The code LGTM 🎉
I added only one comment but it is just a suggestion.

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.

[Android] Gutenberg changes a posts content without informing the UI

3 participants