bug: Twitter plugin ignores media attachments despite declaring supportsMedia() #232

Open
opened 2026-06-29 14:20:20 +00:00 by jmiller · 1 comment
Owner

Description

TwitterService::publish() accepts array $media but never uses it. The plugin declares supportsMedia(): true and getSupportedMediaTypes(): ['image', 'video', 'gif'], but only posts text via the v2 POST /2/tweets endpoint.

Twitter API v2 requires a separate media upload step via the v1.1 media upload endpoint (POST https://upload.twitter.com/1.1/media/upload.json), then referencing the returned media_id in the tweet payload as media.media_ids.

Expected behavior

When $media is non-empty:

  1. Upload each media file via v1.1 chunked upload endpoint
  2. Include media_ids in the tweet JSON body
  3. For threads, attach media to the first tweet

Current behavior

Media URLs are passed to publish() but silently ignored. Posts are always text-only.

Affected file

source/packages/plg_mokosuitecross_twitter/src/Extension/TwitterService.php

## Description `TwitterService::publish()` accepts `array $media` but never uses it. The plugin declares `supportsMedia(): true` and `getSupportedMediaTypes(): ['image', 'video', 'gif']`, but only posts text via the v2 `POST /2/tweets` endpoint. Twitter API v2 requires a separate media upload step via the v1.1 media upload endpoint (`POST https://upload.twitter.com/1.1/media/upload.json`), then referencing the returned `media_id` in the tweet payload as `media.media_ids`. ## Expected behavior When `$media` is non-empty: 1. Upload each media file via v1.1 chunked upload endpoint 2. Include `media_ids` in the tweet JSON body 3. For threads, attach media to the first tweet ## Current behavior Media URLs are passed to `publish()` but silently ignored. Posts are always text-only. ## Affected file `source/packages/plg_mokosuitecross_twitter/src/Extension/TwitterService.php`
Author
Owner

Branch created: feature/232-bug-twitter-plugin-ignores-media-attachm

git fetch origin
git checkout feature/232-bug-twitter-plugin-ignores-media-attachm
Branch created: [`feature/232-bug-twitter-plugin-ignores-media-attachm`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/src/branch/feature/232-bug-twitter-plugin-ignores-media-attachm) ```bash git fetch origin git checkout feature/232-bug-twitter-plugin-ignores-media-attachm ```
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#232