[Koha-bugs] [Bug 13215] letter.code is considered as a primary key

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Nov 7 15:24:28 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13215

--- Comment #9 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 33316
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33316
Bug 13215: The same letter code can be used for several libraries

Review of attachment 33316:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=13215&attachment=33316)
-----------------------------------------------------------------

::: C4/Letters.pm
@@ +123,5 @@
> +            FROM letter
> +            WHERE module = ?
> +            AND code = ?
> +            and branchcode = ?
> +        |

http://wiki.koha-community.org/wiki/Coding_Guidelines#SQL9:_SELECT
Does SQL9 rule apply?

@@ +163,5 @@
> +            WHERE 1
> +        |
> +          . q| AND branchcode = ''|
> +          . ( $module ? q| AND module = ?| : q|| )
> +          . q| ORDER BY name|, { Slice => {} }

Does SQL9 rule apply?

@@ +177,5 @@
> +                WHERE 1
> +            |
> +              . q| AND branchcode = ?|
> +              . ( $module ? q| AND module = ?| : q|| )
> +              . q| ORDER BY name|, { Slice => {} }

Does SQL9 rule apply?

@@ +264,5 @@
> +        DELETE FROM letter
> +        WHERE branchcode = ?
> +          AND module = ?
> +          AND code = ?
> +    | . ( $mtt ? q| AND message_transport_type = ?| : q|| )

Does SQL9 rule apply?

::: t/db_dependent/Letters/GetLetterTemplates.t
@@ +95,5 @@
> +    },
> +];
> +
> +my $sth = $dbh->prepare(
> +q|INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type) VALUES (?, ?, ?, ?, ?, ?, ?)|

See SQL9 rule, I believe.

::: t/db_dependent/Letters/GetLettersAvailableForALibrary.t
@@ +95,5 @@
> +    },
> +];
> +
> +my $sth = $dbh->prepare(
> +q|INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type) VALUES (?, ?, ?, ?, ?, ?, ?)|

SQL9 rule, I believe.

::: tools/letter.pl
@@ +115,4 @@
>      delete_confirm($branchcode, $module, $code);
>  }
>  elsif ( $op eq 'delete_confirmed' ) {
> +    delete_confirmed($branchcode, $module, $code);

mtt was removed, because it is never passed, correct?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list