# Permalink.create(url: /my/path, post\_id: 123)가 더 이상 작동하지 않습니다

**URL:** https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524
**Category:** Bug
**Tags:** development, fixed
**Created:** [11월 21, 2024, 3:30오후 UTC](https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524 "2024-11-21T15:30:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [11월 21, 2024, 3:30오후 UTC](https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524/1 "2024-11-21T15:30:10Z")

</div>

이 커밋 [UX: redesign admin permalinks page (#29634) · discourse/discourse@42b1ca8 · GitHub](https://github.com/discourse/discourse/commit/42b1ca8f78f56d0f60d62163e2cba77e7d03de97#diff-3954e3c5ab52522c3c083981d897876725a4ed1b6ab0073911e54d78fb2351f3L47)

은 `Permalink.create`의 예상되는 동작을 깨뜨린 것 같습니다. 이전에 `post_id` 또는 `topic_id`를 인자로 전달하여 호출할 수 있었지만 (Ruby 프로그래머가 기대하는 방식이기도 합니다), 이제는 다음과 같이 호출해야 합니다:

```plaintext
          Permalink.create!(url: "/my/path/#{import_id}.html", permalink_type_value: pcf.post_id, permalink_type: "post") 

```

이로 인해 퍼마링크를 생성하는 모든 가져오기(import) 스크립트가 깨집니다 ( ./vanilla\_mysql.rb ./zendesk.rb ./muut.rb ./vbulletin3.rb ./jforum.rb ./ipboard.rb ./bbpress.rb ./answerhub.rb ./vbulletin.rb ./mylittleforum.rb ./nodebb/nodebb.rb./telligent.rb ./mybb.rb ./question2answer.rb./smf2.rb ./vbulletin5.rb ./phpbb3/importers/permalink\_importer.rb ./phorum.rb./answerbase.rb./drupal.rb./zendesk\_api.rb)  
또한 `find_or_create_by`와 같은 호출도 더 이상 작동하지 않습니다 (vbulletin3, smf1, xenforo, getsatisfaction이 깨집니다).

이것이 의도된 동작인가요?

테스트도 이 새로운 동작을 지원하도록 변경된 것 같으므로, 맞을 수도 있겠네요?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [11월 22, 2024, 4:48오후 UTC](https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524/4 "2024-11-22T16:48:07Z")

</div>

가능한 해결책을 담은 PR을 생성했습니다:

> <https://github.com/discourse/discourse/pull/29895>
>
> This moves the logic of setting the correct permalink values back into the contr…oller. And it replaces the validation with a simpler one, that always works, even when the model is loaded from the DB.
> 
> Follow-up to https://github.com/discourse/discourse/pull/29634 which broke import scripts and lots of documentation on Meta.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [11월 24, 2024, 4:48오후 UTC](https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524/5 "2024-11-24T16:48:33Z")

</div>

이 주제는 마지막 답변 후 2일 자동으로 닫혔습니다. 더 이상 답변을 게시할 수 없습니다.
