Undefined local variable or method `e' during phpbb3 migration

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
4 Likes

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

Your fix is correct :slight_smile: Can you submit a PR?

Sure thing :slight_smile: will do in a bit

3 Likes

Ok, done: https://github.com/discourse/discourse/pull/4404

3 Likes

Merged :slight_smile:

2 Likes