Make WordPress Core

Opened 2 months ago

Closed 3 weeks ago

Last modified 3 weeks ago

#58051 closed defect (bug) (fixed)

Attachment custom fields not rendered after upload

Reported by: trepmal's profile trepmal Owned by: joedolson's profile joedolson
Milestone: 6.2.1 Priority: normal
Severity: normal Version: 6.2
Component: Media Keywords: has-patch commit fixed-major
Focuses: accessibility, javascript Cc:

Description

This is a follow-up to #40909.

Attachment custom fields added via attachment_fields_to_edit are no longer rendered just after an image is uploaded.

Clicking away and back will restore the custom field markup, but is quite inconvenient.

Attachments (3)

58051-demo.mov (2.9 MB) - added by trepmal 2 months ago.
demonstration of behavior
58051.diff (585 bytes) - added by adamsilverstein 7 weeks ago.
test-custom-fields-upload.mp4 (9.5 MB) - added by adamsilverstein 7 weeks ago.

Change History (23)

@trepmal
2 months ago

demonstration of behavior

#1 @joedolson
2 months ago

  • Milestone changed from Awaiting Review to 6.2.1
  • Owner set to joedolson
  • Status changed from new to accepted

#2 @costdev
2 months ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


2 months ago

#4 @joedolson
2 months ago

Possible ideas include reinitializing the frame after an upload, reverting the change in 40909, and providing the initialize method that was removed with context for where focus should be. But this needs further exploration.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


8 weeks ago

This ticket was mentioned in PR #4315 on WordPress/wordpress-develop by @adamsilverstein.


7 weeks ago
#6

  • Keywords has-patch added; needs-patch removed

#7 @adamsilverstein
7 weeks ago

@joedolson what about something like 58051.diff which triggers the render on the add callback instead? I tested this (briefly) and I see the fields (immediately after uploading completes) - also the focus issue from #40909 still appears resolved.

@trepmal does this fix your issue or cause any unexpected side effects?

This ticket was mentioned in Slack in #core-media by adamsilverstein. View the logs.


7 weeks ago

#9 @joedolson
7 weeks ago

  • Keywords reviewing added

#10 @joedolson
7 weeks ago

  • Keywords commit added; reviewing removed

Test steps:

Failure case:

1) Set up custom fields using code sample on #40909
2) Go to add a featured image to a post.
3) Upload image by dropping into thumbnail grid within the media modal.
4) Verify that attachment fields do not display.

Success case:

1) Apply patch and build.
2) Go to add a featured image to a post.
3) Upload image by dropping into thumbnail grid within the media modal.
4) Verify that attachment fields do display.
5) Add content to test field 1; tab forward to observed focus. Observe that focus stays in field 2.

Tested patch and verified test results as expected.

Marking for commit.

This ticket was mentioned in PR #4322 on WordPress/wordpress-develop by @joedolson.


7 weeks ago
#11

Test against media changes to render attachment fields on new uploads.

Trac ticket: https://core.trac.wordpress.org/ticket/58051

#12 @joedolson
7 weeks ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 55649:

Media: Render attachment custom fields for new uploads.

Initialize attachment custom fields during the add callback, so that fields are present as soon as an attachment is uploaded but do not refresh when field values are changed. Follow up to #40909.

Props trepmal, adamsilverstein, joedolson.
Fixes #58051.

#13 @joedolson
7 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#14 @joedolson
7 weeks ago

Reopened to backport to 6.2.1

#15 @bbreedlove
6 weeks ago

I'm encountering the bug described here and I wanted to pop in and note that I've tested the patch attached on this ticket and it successfully resolves the problem.

#16 @audrasjb
6 weeks ago

  • Keywords fixed-major added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


6 weeks ago

#18 @joedolson
5 weeks ago

#58210 was marked as a duplicate.

#19 @audrasjb
3 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 55735:

Media: Render attachment custom fields for new uploads.

Initialize attachment custom fields during the add callback, so that fields are present as soon as an attachment is uploaded but do not refresh when field values are changed. Follow up to #40909.

Props trepmal, adamsilverstein, joedolson.
Merges [55649] to the 6.2 branch.
Fixes #58051.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.