# Undefined local variable or method \`e' during phpbb3 migration

**URL:** https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861
**Category:** Bug
**Created:** [August 19, 2016, 8:02am UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861 "2016-08-19T08:02:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mbajur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbajur/32/51349_2.png) [@mbajur](https://meta.discourse.org/u/mbajur)
#### Post date: [August 19, 2016, 8:02am UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/1 "2016-08-19T08:02:13Z")

</div>

During a phpbb3 migration, for one of the posts, importer throws:

```
28291 / 1126938 ( 2.5%) [583509 items/min] /var/www/discourse/script/import_scripts/phpbb3/support/text_processor.rb:56:in `rescue in bbcode_to_md': undefined local variable or method `e' for #<ImportScripts::PhpBB3::TextProcessor:0x007f41aa627198> (NameError)
        from /var/www/discourse/script/import_scripts/phpbb3/support/text_processor.rb:54:in `bbcode_to_md'

```

FYI: i’ve been following an official docker-based migration guide.

* * *

Edit: I’ve been able to fix this by editing the `#bbcode_to_md` method to:

```
def bbcode_to_md(text)
  begin
    text.bbcode_to_md(false)
 
  # Added `=>` below
  rescue => e
    puts "Problem converting \n#{text}\n using ruby-bbcode-to-md"
    text
  end
end

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [August 19, 2016, 8:25am UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/2 "2016-08-19T08:25:36Z")

</div>

Sure this is something @gerhard should take a peek at.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 19, 2016, 8:27am UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/3 "2016-08-19T08:27:15Z")

</div>

Your fix is correct 🙂 Can you submit a PR?

---

<div class="post-metadata">

### Author: ![mbajur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbajur/32/51349_2.png) [@mbajur](https://meta.discourse.org/u/mbajur)
#### Post date: [August 19, 2016, 9:07am UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/4 "2016-08-19T09:07:02Z")

</div>

Sure thing 🙂 will do in a bit

---

<div class="post-metadata">

### Author: ![mbajur](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mbajur/32/51349_2.png) [@mbajur](https://meta.discourse.org/u/mbajur)
#### Post date: [August 19, 2016, 11:37am UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/5 "2016-08-19T11:37:32Z")

</div>

Ok, done: [Add missing fat arrow in bbcode\_to\_md method rescue block by mbajur · Pull Request #4404 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/4404)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 19, 2016, 12:11pm UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/6 "2016-08-19T12:11:09Z")

</div>

Merged 🙂

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [August 19, 2016, 12:11pm UTC](https://meta.discourse.org/t/undefined-local-variable-or-method-e-during-phpbb3-migration/48861/7 "2016-08-19T12:11:13Z")

</div>


