• Magnus Enger's avatar
    Bug 19134: C4::SMS falils on long driver name · a4237785
    Magnus Enger authored
    Code in C4::SMS takes the part of the SMS::Send-driver that comes after
    SMS::Send and tries to turn it into part of a path to a YAML file
    that can contain additional parameters to SMS::Send. The current
    code works for e.g. SMS::Send::A::B, but if there is one or more
    extra names, it fails to turn :: into /. So we have:
    SMS::Send::A::B    -> SMS/Send/A/B
    SMS::Send::A::B::C -> SMS/Send/A/B::C
    This patch makes sure all occurrences of :: are turned into /, by
    adding a "g" modifier at the end of the regex.
    Testing this preperly would take a whole lot of setup for a very
    small change. I would suggest that the following two oneliners
    are enough to demonstrate that the change makes sense:
    $ perl -e '$x = "a::b::c"; $x =~ s|::|/|; print $x, "\n";'
    $ perl -e '$x = "a::b::c"; $x =~ s|::|/|g; print $x, "\n";'
    - Check that the output of these oneliners make sense
    - Check that the patch changes the code in a similar way to the
      change from the first oneliner to the second.
    Signed-off-by: Aleisha Amohia's avatarAleisha Amohia <aleishaamohia@hotmail.com>
    Signed-off-by: 's avatarMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
    Signed-off-by: joubu's avatarJonathan Druart <jonathan.druart@bugs.koha-community.org>
SMS.pm 3.6 KB