Search code examples
mojolicious

Mojolicious: DBIx::Class::Row::get_column(): No such column ''


If you were using code like below, to get all the parameters out of a HTML form in a Mojolicious application, you may get the error No such column.

Code causing this error:

  my $fields;
  foreach ($c->req->body_params->param) {
    $fields->{"$_"} = $c->req->body_params->param("$_");
  }

Solution

  • This is due to an update in Mojolicious, which removed multi-name support from various methods.

    The above code should be changed to the much simpler form:

    my $fields = $c->req->body_params->to_hash;