WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

Unchecked default category re-checks itself upon publish or update of a post #40197

Open crobertwatson opened 2 years ago

crobertwatson commented 2 years ago

Description

A WordPress-based news website's editorial team has problems with the default "Uncategorized" category which, long ago, they had renamed to "General". But it's still the default category as WordPress seems to insist on having. Even if they've selected a different category and deselected the default category.

  1. They create a post and check the desired category and uncheck the default "General" category.
  2. Then they click "Publish".
  3. At the last second during the Publish operation, the Block Editor unchecks the user-selected category and re-checks "General".
  4. Then they have to go back into the post and attempt to uncheck "General" and recheck the desired category, then click Update.

They have to do step 4 three or four times to get the result they want. Or they just use "Quick Edit" to change it in the post list.

It doesn't happen every time and is sometimes difficult to reproduce. But it happens often enough to be a problem. I cannot find a way to consistently reproduce it. Nor can I find any indication that this is a known issue with WordPress. It will happen with or without plugins enabled.

It seems somewhat related to https://github.com/WordPress/gutenberg/issues/23970 but that issue is only when nothing is selected for a category. This happens when a user selects a desired category and deselects the default category.

Step-by-step reproduction instructions

  1. Create a post and check the desired category and uncheck the default "General" category.
  2. Then click "Publish".
  3. At the last second during the Publish operation, the Block Editor unchecks the user-selected category and re-checks "General".
  4. Go back into the post and attempt to uncheck "General" and recheck the desired category, then click Update.

Screenshots, screen recording, code snippet

ezgif com-gif-maker

Environment info

WordPress 5.9.3, custom theme, all browsers, Pantheon.io hosting (highest tier plan)

`

wp-core

version: 5.9.3 site_language: en_US user_language: en_US timezone: America/New_York permalink: /%year%/%monthnum%/%day%/%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 14496 dotorg_communication: true

wp-paths-sizes

wordpress_path: /code wordpress_size: loading... uploads_path: /code/hamod-uploads uploads_size: loading... themes_path: /code/wp-content/themes themes_size: loading... plugins_path: /code/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading...

wp-dropins (2)

db.php: true object-cache.php: true

wp-active-theme

name: Hamodia (hamodia) version: 1.0.1 author: Anonymous author_website: (undefined) parent_theme: none theme_features: core-block-patterns, widgets-block-editor, post-thumbnails, automatic-feed-links, title-tag, menus, html5, custom-background, customize-selective-refresh-widgets, custom-logo, widgets, editor-style theme_path: /code/wp-content/themes/hamodia

wp-themes-inactive (3)

Hamodia: version: 0.1, author: josephsilber Twenty Nineteen: version: 1.0, author: the WordPress team Twenty Twenty: version: 1.0, author: the WordPress team

wp-mu-plugins (2)

MU WP Native PHP Sessions: version: 0.1, author: Pantheon Pantheon: version: 0.1, author: Pantheon

wp-plugins-active (26)

AdRotate: version: 5.8.23, author: Arnan de Gans Another WordPress Classifieds Plugin (AWPCP): version: 3.9.5, author: D. Rodenbaugh ARVE Advanced Responsive Video Embedder: version: 9.7.5, author: Nicolas Jonas Disable Comments: version: 2.3.4, author: WPDeveloper Google Tag Manager for Wordpress: version: 1.14.2, author: Thomas Geiger Gravity Forms: version: 2.6.1, author: Gravity Forms Gravity Forms Mailchimp Add-On: version: 5.0.1, author: Gravity Forms Hamodia Core Functionality: version: 0.1, author: Designzillas My Eyes Are Up Here: version: 1.1.10, author: interconnect/it Pantheon Advanced Page Cache: version: 1.0.0, author: Pantheon Perfmatters: version: 1.8.7, author: forgemedia Popup Maker: version: 1.16.7, author: Popup Maker Postmark (Official): version: 1.15.6, author: Andrew Yates & Matt Gibbs Reading Time WP: version: 2.0.10, author: Jason Yingling Redirection: version: 5.2.3, author: John Godley Sassy Social Share: version: 3.3.40, author: Team Heateor Simple Local Avatars: version: 2.2.0, author: Jake Goldman, 10up Solr Power: version: 2.3.2, author: Pantheon Term Management Tools: version: 2.0.1, author: theMikeD, scribu User Role Editor: version: 4.61.2, author: Vladimir Garagulya WooCommerce: version: 6.3.1, author: Automattic WooCommerce Authorize.Net Gateway: version: 3.6.3, author: SkyVerge WooCommerce Subscriptions: version: 4.0.2, author: WooCommerce WP Offload Media: version: 2.6.2, author: Delicious Brains WPS Hide Login: version: 1.9.4, author: WPServeur, NicolasKulka, wpformation Yoast SEO: version: 18.5.1, author: Team Yoast

wp-plugins-inactive (63)

Activity Log: version: 2.7.0, author: Activity Log Team Adminimize: version: 1.11.7, author: Frank Bültge Akismet: version: 3.1.5, author: Automattic All 404 Redirect to Homepage: version: 2.1, author: wp-buy Amazon Web Services: version: 1.0.5, author: Delicious Brains Another WordPress Classifieds Plugin (AWPCP): version: 3.8.5, author: D. Rodenbaugh Anti-Malware Security and Brute-Force Firewall: version: 4.19.69, author: Eli Scheetz Attachment Pages Redirect: version: 1.1.2, author: Samuel Aguilera AWPCP Authorize.Net Module: version: 3.6.4, author: D. Rodenbaugh AWPCP Coupons Module: version: 3.6.2, author: D. Rodenbaugh AWPCP Extra Fields Module: version: 3.6.14, author: D. Rodenbaugh AWPCP Featured Ads Module: version: 3.6.2, author: D. Rodenbaugh AWPCP Fee Per Category Module: version: 3.6, author: D. Rodenbaugh AWPCP Region Control Module: version: 3.6.7, author: D. Rodenbaugh Bulk Move: version: 1.3.0, author: Sudar Classic Editor: version: 1.6, author: WordPress Contributors Contact Form 7: version: 5.4.2, author: Takayuki Miyoshi Contact Form 7 to Post: version: 1.0.0, author: bastho Debug Bar Actions and Filters Addon: version: 1.5.4, author: Subharanjan Directorist - Business Directory Plugin: version: 7.1.2, author: wpWax Disable Emails: version: 1.8.0, author: WebAware Featured Images in RSS for Mailchimp & More: version: 1.5.7, author: 5 Star Plugins FlowPaper: version: 1.9.6, author: Devaldi Ltd Form to Post: version: 0.10, author: Michael Simpson Google XML Sitemaps: version: 4.1.1, author: Auctollo Gravity Forms Authorize.Net Add-On: version: 2.6, author: rocketgenius Hamodia Functionality: version: 0.1, author: Joseph Silber Hamodia Subscriptions: version: 0.1, author: Joseph Silber Hello Dolly: version: 1.6, author: Matt Mullenweg iframe: version: 4.5, author: webvitaly Import and export users and customers: version: 1.19.1.9, author: codection Imsanity: version: 2.7.1, author: Exactly WWW iThemes Security: version: 8.0.2, author: iThemes Maintenance: version: 4.03, author: WebFactory Ltd Manage XML-RPC: version: 1.0, author: brainvireinfo OptinMonster: version: 2.6.9, author: OptinMonster Team Preferred Languages: version: 1.7.0, author: Pascal Birchler Push Notifications for WordPress: version: 3.1, author: Delite Studio S.r.l. Query Monitor: version: 3.8.2, author: John Blackbourn Scheduled Post Trigger: version: 3.0, author: Jennifer Moss - Moss Web Works Simple 301 Redirects: version: 2.0.5, author: WPDeveloper Stock Market Overview: version: 1.6.4, author: Stockdio Styles & Layouts Gravity Forms: version: 4.2.10, author: Sushil Kumar Two Factor: version: 0.7.1, author: Plugin Contributors Two Factor SMS: version: 0.1.1, author: Daisuke Takahashi (Extend Wings) WP-SCSS: version: 2.4.0, author: Connect Think WP2Social Auto Publish: version: 2.3.2, author: xyzscripts.com WP All Import - User Import Add-On Pro: version: 1.1.6, author: Soflyy WP All Import Pro: version: 4.7.2, author: Soflyy WP Bulk Delete: version: 1.2.2, author: Xylus Themes WP Cloudy: version: 4.4.7, author: Benjamin DENIS WP Cloudy Geolocation Add-on: version: 2.6.1, author: Benjamin DENIS WP Cloudy Skin Addon: version: 2.3, author: Benjamin DENIS WP Crontrol: version: 1.10.0, author: John Blackbourn & crontributors WP Data Access: version: 5.1.1, author: Passionate Programmers B.V. WP File Manager: version: 7.1, author: mndpsingh287 WPForce Logout: version: 1.4.5, author: Sanjeev Aryal WP Migrate DB: version: 1.0.17, author: Delicious Brains WP Offload Media Lite: version: 2.5.2, author: Delicious Brains WP Redis: version: 1.2.0, author: Pantheon, Josh Koenig, Matthew Boynes, Daniel Bachhuber, Alley Interactive WP Twitter Auto Publish: version: 1.4.1, author: xyzscripts.com Yet Another Related Posts Plugin (YARPP): version: 5.13.1, author: YARPP Yoast SEO: version: 5.4, author: Team Yoast

wp-media

image_editor: WP_Image_Editor_GD imagick_module_version: 1690 imagemagick_version: ImageMagick 6.9.10-86 Q16 x86_64 2020-01-13 https://imagemagick.org imagick_version: 3.5.1 file_uploads: File uploads is turned off post_max_size: 100M upload_max_filesize: 100M max_effective_size: 100 MB max_file_uploads: 20 gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: 9.27

wp-server

server_architecture: Linux 5.10.90+ x86_64 httpd_software: nginx/1.16.1 php_version: 7.4.27 64bit php_sapi: fpm-fcgi max_input_variables: 10000 time_limit: 120 memory_limit: 512M max_input_time: 900 upload_max_filesize: 100M php_post_max_size: 100M curl_version: 7.61.1 OpenSSL/1.1.1k suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: true

wp-database

extension: mysqli server_version: 10.4.18-MariaDB-log client_version: mysqlnd 7.4.27 max_allowed_packet: 67108864 max_connections: 1024

wp-constants

WP_HOME: https://hamodia.com WP_SITEURL: https://hamodia.com WP_CONTENT_DIR: /code/wp-content WP_PLUGIN_DIR: /code/wp-content/plugins WP_MEMORY_LIMIT: 512M WP_MAX_MEMORY_LIMIT: 512M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: true CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: Undefined DB_CHARSET: utf8mb4 DB_COLLATE: undefined

wp-filesystem

wordpress: not writable wp-content: not writable uploads: writable plugins: not writable themes: not writable mu-plugins: not writable

`

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

carolinan commented 2 years ago

Hi Does this happen when all plugins are disabled? (Personally, I would not be able to test a setup with 26 plugins to troubleshoot the issue, especially if any of them are paid plugins.)

crobertwatson commented 2 years ago

@carolinan Yes, it happens when all plugins are disabled as well. Very strange. It's to the point where we're considering creating a plugin to alter the checkboxes of the categories selection panel and making them radio buttons just to force it to stop randomly selecting the default category.