Import from a file: ask the old site for its category and tag prefixes when the content doesn't show them
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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 内容生成。
描述
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 分钟
- 30 天内合并 PR
- 143
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
temecms/teme 的其他 Issue
-
area/admin type/enhancement when/soon
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
area/media type/enhancement when/soon
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
area/admin type/bug when/soon
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
area/import type/documentation when/soon
难度 2/5 半天 新手友好度 68/100
维护者通常 1 天内回复
-
area/admin area/import type/bug when/later
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
2DAW-CarlosIII/eportfolio_g5#35 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
2DAW-CarlosIII/eportfolio_g4#33 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
2DAW-CarlosIII/eportfolio_g1#34 ·
维护者通常 2 天内回复
-
P2 Team S Type: Infrastructure
难度 2/5 1-3 小时 新手友好度 62/100
google/site-kit-wp#14271 ·
维护者通常 2 天内回复
-
Display price Views field throws TypeError when the row has no product可能已有人在做 @albanycomputers 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
backdrop-contrib/ubercart#610 ·