[Koha-bugs] [Bug 2061] New: labels_conf DB values: NULL vs. 0
bugzilla-daemon at pippin.metavore.com
bugzilla-daemon at pippin.metavore.com
Mon Apr 28 19:32:13 CEST 2008
http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=2061
Summary: labels_conf DB values: NULL vs. 0
Product: Koha
Version: HEAD
Platform: PC
URL: http://staff-atz.dev.kohalibrary.com/cgi-
bin/koha/labels/label-edit-layout.pl
OS/Version: All
Status: NEW
Severity: normal
Priority: P3
Component: Label printing
AssignedTo: mason.james at liblime.com
ReportedBy: joe.atzberger at liblime.com
QAContact: koha-bugs at lists.koha.org
The table lables_conf has a number of columns of type int(1) that are designed
to hold their relative sort order. The default value is zero, except
"classification". Likely, classification should match the others and default
to zero.
It does not seem useful to allow the values to be NULL, since labels code later
makes numerical comparison to the values retrieved. I suggest making the
columns in question "NOT NULL".
Unfortunately, label-edit-layout overwrites the default zero values with NULL
when "saving" an unedited layout. This may be fixed by modifying the
underlying DB, but probably requires the save function to be moderately
intelligent about not writing $query->param('xyz') directly to the database
when xyz is undefined. Essentially, it should screen for undefs and
substitute 0's.
Table description for labels_conf (verbose) below:
+----------------+-------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra
| Privileges | Comment |
+----------------+-------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
| id | int(4) | NULL | NO | PRI | NULL |
auto_increment | select,insert,update,references | |
| barcodetype | char(100) | utf8_general_ci | YES | | NULL |
| select,insert,update,references | |
| title | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| subtitle | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| itemtype | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| barcode | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| dewey | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| classification | int(1) | NULL | YES | | NULL |
| select,insert,update,references | |
| subclass | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| itemcallnumber | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| author | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| issn | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| isbn | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| startlabel | int(2) | NULL | NO | | 1 |
| select,insert,update,references | |
| printingtype | char(32) | utf8_general_ci | YES | | BAR |
| select,insert,update,references | |
| layoutname | char(20) | utf8_general_ci | NO | | TEST |
| select,insert,update,references | |
| guidebox | int(1) | NULL | YES | | 0 |
| select,insert,update,references | |
| active | tinyint(1) | NULL | YES | | 1 |
| select,insert,update,references | |
| fonttype | char(10) | utf8_unicode_ci | YES | | NULL |
| select,insert,update,references | |
| ccode | char(4) | utf8_unicode_ci | YES | | NULL |
| select,insert,update,references | |
| callnum_split | int(1) | NULL | YES | | NULL |
| select,insert,update,references | |
| text_justify | char(1) | utf8_unicode_ci | YES | | NULL |
| select,insert,update,references | |
| formatstring | varchar(64) | utf8_general_ci | YES | | NULL |
| select,insert,update,references | |
+----------------+-------------+-----------------+------+-----+---------+----------------+---------------------------------+---------+
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the Koha-bugs
mailing list