Skip to content

Submit related content selected on the Bulk Submit page (WP-1027) - #640

Open
achursin-smartling wants to merge 1 commit into
masterfrom
WP-1027-bulk-submit-related
Open

achursin-smartling wants to merge 1 commit into
masterfrom
WP-1027-bulk-submit-related

Conversation

@achursin-smartling

Copy link
Copy Markdown

Problem

Since WP-973 (5.1.0) the Bulk Submit job wizard loads related content (featured images, terms, …) for the selected items and sends the user's selection as relations. The backend ignored it: in ContentRelationsDiscoveryService::createSubmissions, the isBulk() branch called bulkUpload() with only the selected IDs and returned. Related content selected on Bulk Submit was never submitted, so for example featured images stayed unmapped on the target site.

Fix

  • The bulk branch now also submits the related items from relations, per target blog, through bulkUpload() so existing submissions are reused. They are queued in the same batch as the selected items. Related IDs that are themselves bulk-selected items of the same type are skipped.
  • Queueing moved into a private enqueueBulk() (no behavior change), so the main items and related items go into one batch.
  • bulkUpload() merged the menu item queue IDs with ArrayHelper::add(), which unions by key ([1] + [2, 3, 4] gives [1, 3, 4]), so some menu item submissions were stored but never queued. It now uses array_merge.
  • Changelog entry under 5.8.3 in readme.txt, and version bumped to 5.8.3 (composer.json, smartling-connector.php, readme.txt stable tag).

Tests

Added ContentRelationsDiscoveryServiceTest::testBulkSubmitHandlerSubmitsSelectedRelations. Not run locally (no PHP environment available), please rely on CI.

Jira: WP-1027

🤖 Generated with Claude Code

The bulk branch of createSubmissions() ignored the relations sent by the
job wizard since WP-973, so e.g. featured images were never submitted.
Also fix menu item queue ids being dropped by the key-based array union.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant