Make WordPress Core

Opened 8 years ago

Last modified 6 months ago

#42910 reopened defect (bug)

Default Post Format doesn't apply on post created from Quick Draft

Reported by: aiyaz's profile aiyaz Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.1
Component: Post Formats Keywords: has-test-info has-unit-tests has-patch dev-feedback needs-dev-note
Focuses: administration Cc:

Description

Default Post Format doesn't keep selected while submitting posts using Quick Draft option of dashboard.

Steps To Reproduce:

  1. Login into the WordPress admin
  2. Navigate to the Settings > Writing
  3. Change the Default Post Format to any format
  4. Clicked on ‘Save changes’ button
  5. Now navigate to the Dashboard
  6. Inside Quick Draft block Add post title and description and Clicked on ‘Save Draft’.
  7. Now check the post format of added post.

Note: it is working after 2-3 attempt but when you again change the post format then it will not work as expected.

Expected result: default post format should be applied on post created from "Quick Draft" option.

Attachments (3)

Dashboard ‹ Wordpress Practice — WordPress.png (105.0 KB) - added by aiyaz 8 years ago.
Dashboard Quick Draft
42910.patch (609 bytes) - added by buddydevelopers 8 years ago.
Conguratulations Ajay, and keep it up. I am adding patch for this Bug.
42910.1.patch (758 bytes) - added by sabernhardt 7 months ago.
refreshed

Download all attachments as: .zip

Change History (25)

@aiyaz
8 years ago

Dashboard Quick Draft

#1 @buddydevelopers
8 years ago

  • Keywords needs-patch added

@buddydevelopers
8 years ago

Conguratulations Ajay, and keep it up. I am adding patch for this Bug.

#2 @buddydevelopers
8 years ago

  • Keywords has-patch added; needs-patch removed

#3 @aiyaz
8 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

#4 @1naveengiri
8 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

#5 @1naveengiri
8 years ago

  • Keywords needs-testing added
  • Resolution set to invalid
  • Status changed from reopened to closed

#6 @1naveengiri
8 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

@sabernhardt
7 months ago

refreshed

#7 follow-ups: @sabernhardt
7 months ago

  • Milestone changed from Awaiting Review to Future Release

The Quick Draft still does not acknowledge the default format change until the second draft with WordPress 6.8.1. With the patch, it honored the new default with the first draft.

However, I would like to know how it worked with the second draft (before the patch).

#8 @SirLouen
7 months ago

  • Keywords has-test-info dev-feedback added; needs-testing removed

Test Report

Description

✅ This report validates that the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/42910/42910.1.patch

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.4.6
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.4.6)
  • Browser: Chrome 136.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  • Tested using OP testing instructions

#9 @sandeepdahiya
6 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: Patch-4291.1.patch

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Firefox 139.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  1. Before applying the patch, changed the Default Post Format under General -> Writing menu to 'Quote' and after saving 'Quick Draft', it was changed to 'Standard'.
  1. After applying patch, it worked as expected and didn't change under Quick draft.

Supplemental Artifacts

Test results after patch: Video

#10 in reply to: ↑ 7 @sandeepdahiya
6 months ago

Replying to sabernhardt:

The Quick Draft still does not acknowledge the default format change until the second draft with WordPress 6.8.1. With the patch, it honored the new default with the first draft.

After the patch, Quick Draft is recognizing the default format change with both the drafts.

However, I would like to know how it worked with the second draft (before the patch).

Before the patch, Quick draft was only acknowledging the second draft. See this: before the patch Video.

#11 in reply to: ↑ 7 ; follow-up: @SirLouen
6 months ago

  • Keywords needs-test-info added; has-test-info dev-feedback removed

Replying to sabernhardt:

The Quick Draft still does not acknowledge the default format change until the second draft with WordPress 6.8.1. With the patch, it honored the new default with the first draft.

However, I would like to know how it worked with the second draft (before the patch).

I can't understand your concerns. Can you explain me how to reproduce what you mention here?

#12 in reply to: ↑ 11 ; follow-up: @sandeepdahiya
6 months ago

Replying to SirLouen:

I can't understand your concerns. Can you explain me how to reproduce what you mention here?

I think I have reproduced @sabernhardt's concerns related to before-the-patch here and after-the-patch results.

Please first watch these two videos and then you will understand the comment.

#13 in reply to: ↑ 12 @SirLouen
6 months ago

  • Keywords has-test-info added; needs-test-info removed

Replying to sandeepdahiya:

Please first watch these two videos and then you will understand the comment.

Thanks! Now it makes all sense to me. I knew that @sabernhardt never gives a free launch, so I was curious about his concern. Now it makes sense to me to understand what's going on here.

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


6 months ago
#14

  • Keywords has-unit-tests added

The post_type was never been set in during the wp_dashboard_quick_press but in that function, there is a mechanism that replicates all the information from the last post, this was the reason it was not set during the initial creation but set during the second

I've added a new patch that more adequately solves this problem within where it should actually be (in the wp_dashboard_quick_press) including some unit testing coverage to check if the wp_dashboard_quick_press is displaying what it should be displaying.

@sandeepdahiya if you can test this new patch version again, it would be great.

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

#15 @SirLouen
6 months ago

  • Keywords needs-testing added

#16 @sandeepdahiya
6 months ago

  • Keywords dev-feedback added; needs-testing removed

Test Report

Description

✅ This report validates that the indicated patch works as expected.

Patch tested: Patch-8936.diff

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.5
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
  • Browser: Firefox 139.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch and Quick draft feature is working as expected. After the patch video
  1. ✅ All unit tests in includesDashboard.php passed successfully.
$ npm run test:php -- tests/phpunit/tests/admin/includesDashboard.php

> WordPress@6.9.0 test:php
> node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpunit tests/phpunit/tests/admin/includesDashboard.php

Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 9.6.23 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

.                                                                   1 / 1 (100%)

Time: 00:00.545, Memory: 38.50 MB

OK (1 test, 2 assertions)

Additional Notes

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


6 months ago

#18 @SirLouen
6 months ago

  • Keywords changes-requested needs-unit-tests needs-patch added; has-patch has-unit-tests dev-feedback removed

As per todays <bug-scrub> one idea has arisen to improve the current state of the plugin.

Instead of fixing the default post format to the wp_dashboard_quick_press, it can be amended within the AJAX call on submit. This could help for extensibility purposes (for example, if someone is willing to set a default post format, just for the quick press widget)

The problem here is that unit tests need to be moved from PHPUnit to Playwright to automatically deliver a draft and check on the fly if the default post format is being set and/or (extra credits) a custom default format could be set.

Based on this information, please take this PR as a reference

#19 @SirLouen
6 months ago

  • Keywords has-unit-tests has-patch added; changes-requested needs-unit-tests needs-patch removed

There is an error in PHPUnit that I cannot reproduce

> WordPress@6.9.0 test:php
> node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpunit --filter WP_Customize_Nav_Menus::test_available_item_types

Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 9.6.23 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

.                                                                   1 / 1 (100%)

In fact, this is not something I'm manipulating in the patch.

Wondering what's going on here.

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


6 months ago

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


6 months ago

#22 @SirLouen
6 months ago

  • Keywords dev-feedback needs-dev-note added

6.9.0 Milestone proposed during today's <bug-scrub>
More information

Note: See TracTickets for help on using tickets.