Import from a file: ask the old site for its category and tag prefixes when the content doesn't show them

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

Start in app/Domain/Import/File/FileAddresses.php at bases(), which picks the prefix from content links and falls back to the WordPress defaults. Then read app/Domain/Media/Downloads/FileDownloader.php to see how the checked, pinned requests to the old site are made, and resources/js/components/import/file-plan.tsx for where the prefixes are shown. Done means that a site with no prefix-revealing links gets its prefixes from the old site's category and tag addresses, and the content links and defaults still apply as before.

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

説明

area/import type/enhancement when/later

What happens now

When an export file is read, Teme guesses the old site's category and tag prefixes (FileAddresses::bases()): it looks at the links in the content that point to the site's own categories and tags, and takes the prefix they use most. When the content has no such links, it falls back to WordPress's defaults, category and tag.

So a site that stripped the category prefix (for example with Yoast's "Remove category prefix") and whose posts never link to a category gets category prefilled. Someone who doesn't remember the old setting imports with the wrong addresses, and every old category link answers 404.

What it could do

When the old site answers (the plan page already asks it, for the media download), and the content gave no answer, ask the site itself: request one category's address with the prefix and without (/category/<slug>/ and /<slug>/), and one tag's the same way, and prefill whichever answers. The links in the content still decide when they exist; WordPress's defaults stay the last fallback. The person can still change the prefixes on the plan page, as today.

Where: app/Domain/Import/File/FileAddresses.php (bases()), app/Domain/Media/Downloads/FileDownloader.php (the checked, pinned requests to the old site), resources/js/components/import/file-plan.tsx.

Related: #696 (the same check of the old site).

主要言語
PHP
スター
1
フォーク
1
平均マージ
1時間 40分
マージ済み PR(30日)
143

環境構築

はじめの一歩

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

temecms/teme のほかの issue

temecms/teme の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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