Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#54955 closed defect (bug) (fixed)

Custom fields Issue

Reported by: gadhiyaravi's profile gadhiyaravi Owned by: joedolson's profile joedolson
Milestone: 5.9.1 Priority: normal
Severity: major Version: 5.9
Component: Editor Keywords: has-patch commit fixed-major
Focuses: ui, accessibility, javascript Cc:

Description

Custom fields glitch: when i am trying to add custom field, it is not showing correctly, Image link:
https://ibb.co/Zc1VGx7

Attachments (5)

custom-fild.jpg (57.1 KB) - added by gadhiyaravi 2 years ago.
Image
54955.patch (542 bytes) - added by ravipatel 2 years ago.
Patch for when added a meta box and show ajax layout top and fixed with this patch
Screenshot_1.png (41.2 KB) - added by ravipatel 2 years ago.
After added this css, field structure display like this.
category-input-success-error.png (12.1 KB) - added by joedolson 2 years ago.
Screenshot with blank success notification after inserting new category from block editor.
54995.2.patch (1.2 KB) - added by sabernhardt 2 years ago.
keeping success message on Taxonomy screen but removing extra code from editor screen (custom fields and categories)

Download all attachments as: .zip

Change History (24)

@gadhiyaravi
2 years ago

Image

#1 @Boniu91
2 years ago

Thank you for creating the ticket! I'm able to reproduce.

Steps to test

  1. Use WordPress 5.9
  2. Add new page in the Settings - Preferences - Panels enable Custom Fields
  3. Add custom field and save it
  4. See the success message not being styled correctly

#2 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 5.9.1

@ravipatel
2 years ago

Patch for when added a meta box and show ajax layout top and fixed with this patch

@ravipatel
2 years ago

After added this css, field structure display like this.

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


2 years ago

#4 @joedolson
2 years ago

There's a related issue found when adding a new category term in the editor. This could be related to #42937.

@joedolson
2 years ago

Screenshot with blank success notification after inserting new category from block editor.

#5 @joedolson
2 years ago

  • Owner set to joedolson
  • Status changed from new to accepted

#6 @sabernhardt
2 years ago

  • Focuses javascript added
  • Keywords needs-patch added

I did not think this was related to r52170, but removing successmsg += response.data; confirmed it. The table row output is in the response.data for an Ajax call in the custom fields section.

One way to avoid the custom fields message is checking whether the admin screen is editing the Taxonomy terms before adding response.data to the message:

	if ( jQuery( 'body' ).hasClass( 'edit-tags-php' ) ) {
		successmsg += response.data;
	}

That option is not ideal, especially if WordPress adds success messages elsewhere, though it might be good enough for now.

To avoid empty messages, the err.length check's else statement needs to check the successmsg length:

	} else if ( successmsg.length ) {

#7 @SergeyBiryukov
2 years ago

#55047 was marked as a duplicate.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


2 years ago

#9 follow-up: @audrasjb
2 years ago

As discussed during today's bug scrub, there is two steps in this ticket:

  1. Remove completely the success message for now, and ship it in 5.9.1, as a bug fix.
  2. Open a new ticket to consider adding success messages the good way, as an enhancement.

@sabernhardt
2 years ago

keeping success message on Taxonomy screen but removing extra code from editor screen (custom fields and categories)

#10 @sabernhardt
2 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

#11 @joedolson
2 years ago

  • Keywords commit added; needs-testing removed

Tested: unwanted empty notices not showing, category success message is showing, as expected.

#12 @joedolson
2 years ago

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

In 52672:

Comments: Only render term update notices on term screens.

Prevent blank notices from appearing when adding custom fields or terms in the post editor.

Props gadhiyaravi, Boniu91, ravipatel, sabernhardt.
Fixes #54955. See #42937.

#13 @SergeyBiryukov
2 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backporting to the 5.9 branch.

#14 in reply to: ↑ 9 @SergeyBiryukov
2 years ago

Replying to audrasjb:

Open a new ticket to consider adding success messages the good way, as an enhancement.

Follow-up: #55078.

#15 @SergeyBiryukov
2 years ago

When committing a fix for a minor release, please don't forget to also reopen the ticket for backporting to the branch and add the fixed-major keyword. Otherwise, the ticket stays on the milestone for the next minor release, but is not actually fixed there :)

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


2 years ago

#17 @joedolson
2 years ago

Thanks for the note @SergeyBiryukov! I didn't know that I needed to do that, so I've added it to my notes.

#18 @peterwilsoncc
2 years ago

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

In 52728:

Editor: Only render term update notices on term screens.

Prevent blank notices from appearing when adding custom fields or terms in the post editor.

Props gadhiyaravi, Boniu91, ravipatel, sabernhardt, joedolson.
Fixes #54955. See #42937.

#19 @peterwilsoncc
2 years ago

In 53123:

Administration: Remove term page check from ajax-response.js.

Replace hard coded check for the term creation page in _enqueues/lib/ajax-response.js with a check for a notification to display in the AJAX response data.

Follow up to [52170], [52672].

Props SergeyBiryukov, ryokuhi, johnregan3, sabernhardt, joedolson.
Fixes #55078.
See #54955.

Note: See TracTickets for help on using tickets.