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

Fixes Caption Loss with Gallery, saves captions using rest API #16340

Closed
wants to merge 1 commit into from
Closed

Fixes Caption Loss with Gallery, saves captions using rest API #16340

wants to merge 1 commit into from

Conversation

kadencewp
Copy link
Contributor

Description

This saves captions that are edited and written in Gutenberg for the gallery block.

Fixes: #8310

Related: #15004

How has this been tested?

Add a gallery with images, edit image captions. Check media library and captions are saved.

Screenshots

Types of changes

Uses debounce from Lodash to keep the calls to the rest API to a minimum.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

body: data,
method: 'POST',
} );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should we do so in the Gallery and not in the Image. I think the decision has been made in Gutenberg to not persist the caption into the Media Library because it's a confusing flow if you have the same image in multiple posts, but you want the caption to be different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @youknowriad, when I worked on this and pushed this I wasn't aware of that decision, I was only trying to be helpful. I tried to read up on what others had posted about this and provide a possible solution that made sense to me. You can close this if you want.

Wherever that decision was made it seems to me like its a more confusion workflow with it not syncing with the media library. Especially when you edit the gallery and lose your captions. ¯_(ツ)_/¯

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I added the "Needs Design Feedback" to get some opinions. I highly appreciate your willingness to contribute. I'm hoping we could find some ways to improve the flows there.

@youknowriad youknowriad added the Needs Design Feedback Needs general design feedback. label Jun 28, 2019
@MDWolinski
Copy link

This was discussed in #design today. While I could see a benefit to this PR, when users tend to use the same image multiple times, it seems this could cause more confusion for the end user. For example, I have an image that via the media library, I set a default caption for. When I add that media into a post and update the caption for that post, I'm next expecting the caption to be saved back to the media library.

However, with a way to say, yes, update this caption back, then I'm good with it, but that seems to be overloading the front-end interface.

@youknowriad
Copy link
Contributor

Let's close this for now, and revisit later if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gallery Block: The "Edit Gallery" modal is unaware of any captions added within Gutenberg.
3 participants