Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug: PushMD - path conflict on duplicate slug for posts in draft

オープン
#95 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
php
領域
backend

調査の方向性

class-push-md-plugin.php の export_wordpress_content() から始め、投稿がどのようにリポジトリの Markdown パスになるかを確認します。次に ExportPathTest.php を調べ、同じ slug を共有する複数の下書きまたは保留中の投稿について、公開済み投稿の優先順位を含むテストカバレッジを追加します。エクスポートがパスの衝突なしに完了し、重複したエントリが ID ベースのフォールバックパスを使用すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

WordPress allows multiple non-published posts (e.g. draft, pending) to share the exact same post_name slug (e.g., my-draft-post). When exporting via Git (git clone / git fetch), PushMD attempts to write both posts to post/my-draft-post.md, causing a file path collision exception: Git export rejected because multiple WordPress entities map to the same PushMD path.

We can disambiguate duplicate slug collisions during export by falling back to ID-based paths (e.g., post/post-202.md) for colliding entries (giving published posts priority).

Proposed Changes
Push MD Plugin
[MODIFY] class-push-md-plugin.php
Update export_wordpress_content() to handle slug collisions gracefully.
Sort posts during export prioritize published posts before draft/pending/private posts.
When two or more posts resolve to the exact same repository markdown path, assign the human-readable slug path to the primary post and fallback to build_id_fallback_markdown_path($post) (post/post-.md or page/page-.md) for duplicate entries.

[MODIFY] ExportPathTest.php
Add unit tests verifying that multiple draft posts with identical slugs export cleanly without throwing exceptions, using ID fallback paths for duplicates.

主要言語
PHP
スター
22
フォーク
5
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/php-toolkit のほかの issue

Automattic/php-toolkit の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。