Bug 30916 - Staged import fails if a title is longer than 128 characters
Summary: Staged import fails if a title is longer than 128 characters
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic record staging/import (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-07 08:25 UTC by Katrin Fischer
Modified: 2023-06-08 22:26 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2022-06-07 08:25:54 UTC
The staged import tools will fail, if you try to import a record that has a title longer than 128 characters, as import_biblios.title is varchar(128). In comparison, biblio.title is mediumtext.

We should make the fields match up or at least extend the size of import_biblios.title.
Comment 1 Katrin Fischer 2022-06-07 08:36:28 UTC
I've tried to update locally to mediumtext, but this appears to fail because title is part of the PK.
Comment 2 Katrin Fischer 2022-06-07 08:57:10 UTC
This is an "old version" problem. In master, this table is 'prettier':

DROP TABLE IF EXISTS `import_biblios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `import_biblios` (
  `import_record_id` int(11) NOT NULL,
  `matched_biblionumber` int(11) DEFAULT NULL,
  `control_number` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `original_source` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `author` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isbn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `has_items` tinyint(1) NOT NULL DEFAULT 0,
  KEY `import_biblios_ibfk_1` (`import_record_id`),
  KEY `matched_biblionumber` (`matched_biblionumber`),
  KEY `title` (`title`(191)),
  KEY `isbn` (`isbn`(191)),
  CONSTRAINT `import_biblios_ibfk_1` FOREIGN KEY (`import_record_id`) REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;