Fixed text sigle legacy support
Change-Id: I227b855b80bf1bc7d9c59e1d2347adfed622774b
diff --git a/lib/Kalamar.pm b/lib/Kalamar.pm
index 2511e68..eea8bfe 100644
--- a/lib/Kalamar.pm
+++ b/lib/Kalamar.pm
@@ -7,7 +7,7 @@
use File::Temp qw/tmpnam/;
# Minor version - may be patched from package.json
-our $VERSION = '0.21';
+our $VERSION = '0.22';
# TODO: Use CSRF!!!
# TODO: The FAQ-Page has a contact form for new questions
diff --git a/lib/Kalamar/API.pm b/lib/Kalamar/API.pm
index 2a8806c..51273f8 100644
--- a/lib/Kalamar/API.pm
+++ b/lib/Kalamar/API.pm
@@ -1,6 +1,7 @@
package Kalamar::API;
use Mojo::Base 'Mojolicious::Plugin';
use Scalar::Util qw/blessed weaken/;
+use Mojo::JSON qw/true false/;
use strict;
use warnings;
@@ -542,8 +543,12 @@
# Cleanup single match
sub _map_match {
my $x = shift or return;
- $x->{matchID} =~ s/^match\-(?:[^!]+!|[^_]+_)[^\.]+?\.[^-]+?-// or
- $x->{matchID} =~ s!^match\-(?:[^\/]+\/){2}[^-]+?-!!;
+
+ # legacy match id
+ if ($x->{matchID}) {
+ $x->{matchID} =~ s/^match\-(?:[^!]+!|[^_]+_)[^\.]+?\.[^-]+?-// or
+ $x->{matchID} =~ s!^match\-(?:[^\/]+\/){2}[^-]+?-!!;
+ };
(
$x->{corpusID},