# Permalink.create(url: /my/path, post\_id: 123) não funciona mais

**URL:** https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524
**Category:** Bug
**Tags:** development, fixed
**Created:** [Novembro 21, 2024, 3:30pm 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:** 1
**Showing post:** 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: [Novembro 21, 2024, 3:30pm 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>

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

parece ter quebrado o comportamento esperado de `Permalink.create`. Em vez de poder chamá-lo com um `post_id` ou `topic_id` como funcionava antes (e o que um programador Ruby esperaria?), agora você precisa chamá-lo assim:

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

```

Isso quebra todos os scripts de importação que criam permalinks ( ./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)  
E chamadas como `find_or_create_by` também não funcionam mais (quebrando vbulletin3, smf1, xenforo e getsatisfaction).

Isso é esperado?

Parece que os testes também foram alterados para suportar esse novo comportamento, então talvez sim?

---

_[View the full topic](https://meta.discourse.org/t/permalink-create-url-my-path-post-id-123-no-longer-works/337524)._
