# Import script (phpbb)

**URL:** https://meta.discourse.org/t/import-script-phpbb/40424
**Category:** Bug
**Created:** [March 2, 2016, 1:30am UTC](https://meta.discourse.org/t/import-script-phpbb/40424 "2016-03-02T01:30:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [March 2, 2016, 1:30am UTC](https://meta.discourse.org/t/import-script-phpbb/40424/1 "2016-03-02T01:30:06Z")

</div>

Hello.

I tried this against the latest discourse master bff965327c0677768e58dd9eaf2b834a22d2342f

The issue is if you have a phpbb post that contains exactly

```
https://www.youtube.com/watch?v=COvnHv42T-A

```

and you are using @neil’s version of bbcode\_to\_md. You have a raw post\_text of

```
<!-- m --><a class="postlink" href="https://www.youtube.com/watch?v=COvnHv42T-A">https://www.youtube.com/watch?v=COvnHv42T-A</a><!-- m -->

```

which goes through text\_processor.rb process\_links which changes it to

```
[youtube.com/watch?v=COvnHv42T-A](https://www.youtube.com/watch?v=COvnHv42T-A)

```

which then goes through bbcode\_to\_md code and turns into

```
http://www.youtube.com/watch?v=COvnHv42T-A)

```

It seems that the problem is that the import script text\_processor is assuming that process\_links is going to happen after the bbcode\_to\_md is run in base.rb, but it happens before. If I reverse the order of them by moving the bbcode\_to\_md call into text\_processor.rb, it seems to fix it, but I’m not sure if that breaks other import scripts.

Ryan

---

<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: [March 2, 2016, 9:04am UTC](https://meta.discourse.org/t/import-script-phpbb/40424/2 "2016-03-02T09:04:28Z")

</div>

Yeah, I noticed that too. Never found the time for fixing it.  
I usually recommend to import without _bbcode\_to\_md_. In my experience it’s not worth the effort since it has a lot of small issues like this.

---

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [March 2, 2016, 10:42pm UTC](https://meta.discourse.org/t/import-script-phpbb/40424/3 "2016-03-02T22:42:56Z")

</div>

@gerhard Maybe I don’t understand what bbcode\_to\_md does, but if you don’t use bbcode\_to\_md, doesn’t that mean there will be bbcodes in your posts?

---

<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: [March 2, 2016, 10:50pm UTC](https://meta.discourse.org/t/import-script-phpbb/40424/4 "2016-03-02T22:50:07Z")

</div>

It depends on the BBCodes you are using. The default ones are handled quite well even without bbcode\_to\_md.  
Discourse already [supports some BBCodes](https://meta.discourse.org/t/post-format-reference-documentation/19197/2) and the import script tries to replace the not supported ones.

Just give it a try and look at the result. 😉

---

<div class="post-metadata">

### Author: ![ryantm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ryantm/32/134063_2.png) [@ryantm](https://meta.discourse.org/u/ryantm)
#### Post date: [March 2, 2016, 11:18pm UTC](https://meta.discourse.org/t/import-script-phpbb/40424/5 "2016-03-02T23:18:00Z")

</div>

Ah, okay. I made a PR to move where the bbcode\_to\_md conversion happens for phpbb: [phpbb-import-script: move bbcode\_to\_md to before other text processing by ryantm · Pull Request #4054 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/4054)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [July 28, 2016, 11:16am UTC](https://meta.discourse.org/t/import-script-phpbb/40424/6 "2016-07-28T11:16:09Z")

</div>


