Skip to content

Fix undefined $status_url in SyncDiscourseTopic::list_topic() - #610

Merged
angusmcleod merged 1 commit into
discourse:mainfrom
SvetZitrka:fix/list-topic-status-path
Sep 14, 2026
Merged

angusmcleod merged 1 commit into
discourse:mainfrom
SvetZitrka:fix/list-topic-status-path

Conversation

@SvetZitrka

Copy link
Copy Markdown
Contributor

lib/sync-discourse-topic.php (~line 226): list_topic() builds $status_path = "/t/{$topic_id}/status" but then calls $this->discourse_request( $status_url, $args ) with an undefined variable. Result: the PUT to re-list a topic goes to an empty path (WP_Error), so an unlisted topic is never re-listed after the post is published, and PHP logs Warning: Undefined variable $status_url in lib/sync-discourse-topic.php:226 on every publish (WP 7.1, plugin 2.6.4).

One-line fix: pass $status_path. Same change as the abandoned #588 (closed when the author deleted their fork).

list_topic() builds $status_path but passes the undefined $status_url to discourse_request(), so the PUT to re-list a topic goes to an empty path and PHP logs "Undefined variable $status_url" on every publish. One-line fix: pass $status_path.
@angusmcleod

Copy link
Copy Markdown
Collaborator

Thanks! This will be in the next release.

@angusmcleod
angusmcleod merged commit f736cbe into discourse:main Sep 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants