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

Fix issues with uploading and hotlinking story poster #12030

Merged
merged 9 commits into from
Jul 28, 2022

Conversation

swissspidy
Copy link
Collaborator

@swissspidy swissspidy commented Jul 27, 2022

Context

Apparently #11982 / v1.23.1 didn't completely fix all issues with story posters, see #12029

Summary

This PR attempts to consolidate logic for (hotlinked) story posters to ensure expected behavior is met.

Relevant Technical Choices

Move the relevant logic to the REST controller so that the JS code does not have to deal with it. Adds a new story_poster field to the API response.

Updates getStoryPropsToSave in story-editor to not return any meta object. getStorySaveData in wp-story-editor already handles that.

To-do

  • Add tests
  • Check that REST API preloading still works

User-facing changes

Testing Instructions

  • This is a non-user-facing change and requires no QA

This PR can be tested by following these steps:

  1. Create a new story
  2. Add a new poster image from the media library, publish.
  3. Save story
  4. Refresh editor (or go to dashboard), see new poster image reflected in both editor and dashboard
  5. Repeat with a hotlinked image
  6. In general, saving should still work as expected

Reviews

Does this PR have a security-related impact?

No

Does this PR change what data or activity we track or use?

No

Does this PR have a legal-related impact?

No

Checklist

  • This PR addresses an existing issue and I have linked this PR to it in ZenHub
  • I have tested this code to the best of my abilities
  • I have verified accessibility to the best of my abilities (docs)
  • I have verified i18n and l10n (translation, right-to-left layout) to the best of my abilities
  • This code is covered by automated tests (unit, integration, and/or e2e) to verify it works as intended (docs)
  • I have added documentation where necessary
  • I have added a matching Type: XYZ label to the PR

Fixes #12029

@swissspidy swissspidy added Type: Bug Something isn't working Group: WordPress Changes related to WordPress or Gutenberg integration labels Jul 27, 2022
@swissspidy swissspidy self-assigned this Jul 27, 2022
@swissspidy swissspidy removed the request for review from spacedmonkey July 27, 2022 11:40
@googleforcreators-bot
Copy link
Collaborator

googleforcreators-bot commented Jul 27, 2022

Plugin builds for a445657 are ready 🛎️!

@swissspidy swissspidy changed the title [WIP] Fix issues with uploading and hotlinking story poster Fix issues with uploading and hotlinking story poster Jul 27, 2022
Copy link
Contributor

@miina miina left a comment

Choose a reason for hiding this comment

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

Seems to work as expected now! Checked the JS files only.

Copy link
Contributor

@timarney timarney left a comment

Choose a reason for hiding this comment

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

Tested as per instructions --- worked locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: WordPress Changes related to WordPress or Gutenberg integration Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Continued issues with story poster in v1.23.1
5 participants