10up / distributor

Share content between your websites.
https://distributorplugin.com
GNU General Public License v2.0
637 stars 156 forks source link

[Block themes] Pulled posts author details are not replaced as author is unset #1129

Closed peterwilsoncc closed 1 year ago

peterwilsoncc commented 1 year ago

Describe the bug

When pulling content from other sites, the author ID is set to zero and this can cause a bug in which the author details are not replaced with the name of the source site.

This appears only to affect block themes.

Steps to Reproduce

  1. Install Distributor 2.0.0 on multiple sites
  2. Link each site to the other as an external connection
  3. Ensure each site is running a block theme (2023 for example)
  4. Create a post on one of the sites
  5. On the other site, visit Distributor > Pull content
  6. Uncheck the "pull as draft" checkbox
  7. Click pull in the post list table for the post you created
  8. Once pull is completed, you will be taken to a new list table of pulled posts
  9. Click view on the pulled post
  10. Observe the byline is empty

Screenshots, screen recording, code snippet

Screen Shot 2023-09-06 at 10 10 18 am

Environment information

No response

WordPress information

WP info ``` ### wp-core ### version: 6.3.2-alpha-56487 site_language: en_US user_language: en_US timezone: +00:00 permalink: /%year%/%monthnum%/%postname%/ https_status: false multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: local user_count: 5 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /vagrant/wp-build wordpress_size: loading... uploads_path: /vagrant/content/uploads uploads_size: loading... themes_path: /vagrant/content/themes themes_size: loading... plugins_path: /vagrant/content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-dropins (1) ### db.php: true ### wp-active-theme ### name: Twenty Twenty-Three (twentytwentythree) version: 1.2 author: the WordPress team author_website: https://wordpress.org parent_theme: none theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, block-templates, widgets-block-editor theme_path: /vagrant/wp-build/wp-content/themes/twentytwentythree ### wp-themes-inactive (12) ### Twenty Eleven: version: 4.4, author: the WordPress team Twenty Fifteen: version: 3.5, author: the WordPress team Twenty Fourteen: version: 3.7, author: the WordPress team Twenty Nineteen: version: 2.6, author: the WordPress team Twenty Seventeen: version: 3.3, author: the WordPress team Twenty Sixteen: version: 3.0, author: the WordPress team Twenty Ten: version: 3.9, author: the WordPress team Twenty Thirteen: version: 3.9, author: the WordPress team Twenty Twelve: version: 4.0, author: the WordPress team Twenty Twenty: version: 2.3, author: the WordPress team Twenty Twenty-One: version: 1.9, author: the WordPress team Twenty Twenty-Two: version: 1.5, author: the WordPress team ### wp-mu-plugins (7) ### nope-post-abstraction-dumps.php: author: (undefined), version: (undefined) nope-push-nope-pull.php: author: (undefined), version: (undefined) show-stable-dist.php: author: (undefined), version: (undefined) simple-auto-distribute.php: author: (undefined), version: (undefined) snippet-auto-unlink.php: author: (undefined), version: (undefined) unsafe-app-passwords.php: author: (undefined), version: (undefined) _qm-mappings.php: author: (undefined), version: (undefined) ### wp-plugins-active (3) ### Distributor: version: 2.0.0, author: 10up Inc. Query Monitor: version: 3.13.1, author: John Blackbourn User Switching: version: 1.7.0, author: John Blackbourn & contributors ### wp-plugins-inactive (6) ### Classic Editor: version: 1.6.3, author: WordPress Contributors Distributor: version: 1.9.1, author: 10up Inc. Distributor - Edit Remote Post Meta: version: 0.2.1, author: 10up Newspack Image Credits: version: 1.0.1, author: Automattic, INN Labs, Project Argo Test block: author: (undefined), version: (undefined) Yoast SEO: version: 21.0, author: Team Yoast (latest version: 21.1) ### wp-media ### image_editor: WP_Image_Editor_GD imagick_module_version: Not available imagemagick_version: Not available imagick_version: Not available file_uploads: File uploads is turned off post_max_size: 1024M upload_max_filesize: 1024M max_effective_size: 1 GB max_file_uploads: 20 gd_version: 2.3.3 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: not available ### wp-server ### server_architecture: Linux 5.15.0-30-generic x86_64 httpd_software: nginx/1.18.0 php_version: 7.4.33 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 900 memory_limit: 128M admin_memory_limit: 256M max_input_time: 900 upload_max_filesize: 1024M php_post_max_size: 1024M curl_version: 7.81.0 OpenSSL/3.0.2 suhosin: false imagick_availability: false pretty_permalinks: true current: 2023-09-06T05:39:02+00:00 utc-time: Wednesday, 06-Sep-23 05:39:02 UTC server-time: 2023-09-06T05:38:59+00:00 ### wp-database ### extension: mysqli server_version: 8.0.30-0ubuntu0.22.04.1 client_version: mysqlnd 7.4.33 max_allowed_packet: 16777216 max_connections: 151 ### wp-constants ### WP_HOME: http://xu-distributor.local WP_SITEURL: http://xu-distributor.local/wp WP_CONTENT_DIR: /vagrant/content WP_PLUGIN_DIR: /vagrant/content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: true WP_DEBUG_DISPLAY: false WP_DEBUG_LOG: true SCRIPT_DEBUG: true WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: local WP_DEVELOPMENT_MODE: undefined DB_CHARSET: utf8 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable ### distributor ### 0: 2.0.0 1: No 2: N/A 3: Override Author Byline: Yes Media Handling: Featured image only 4: N/A 5: MS1: - URL: http://ms-distributor.local/wp-json/ - Version: 2.0.0 - Status: valid - Auth method: Username / Password - Username: admin - Roles Allowed to Push: administrator, editor - Additional data: {"errors":[], "can_post":["post", "page", "attachment", "nav_menu_item", "wp_block", "wp_template", "wp_template_part", "wp_navigation"], "can_get":["post", "page", "attachment", "nav_menu_item", "wp_block", "wp_template", "wp_template_part", "wp_navigation"], "endpoint_suggestion":false, "is_authenticated":"yes"} ```

Code of Conduct

margaretschneider commented 1 year ago

Just a data point: At least one Newspack publisher whose site recently updated to the 2.0.0 version of the plugin confirms that the steps described here reproduce the bug they've been experiencing with author data not coming through since the update. They're currently having to add that data manually to all posts imported with Distributor, so the rollout of this bug fix would be much appreciated. Thank you!