From c3b5ffa31f99ac61cc80b79a948de39f7a951296 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 24 Feb 2026 12:06:05 +0100 Subject: [PATCH 1/2] Change type of csvimport_import.comment to LONGTEXT Fixes #231 --- Module.php | 9 +++++++-- config/module.ini | 2 +- src/Entity/CSVImportImport.php | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Module.php b/Module.php index f6b0c49f..51ac2058 100644 --- a/Module.php +++ b/Module.php @@ -25,7 +25,7 @@ public function install(ServiceLocatorInterface $serviceLocator) id INT AUTO_INCREMENT NOT NULL, job_id INT NOT NULL, undo_job_id INT DEFAULT NULL, - comment VARCHAR(255) DEFAULT NULL, + comment LONGTEXT DEFAULT NULL, resource_type VARCHAR(255) NOT NULL, has_err TINYINT(1) NOT NULL, stats LONGTEXT NOT NULL COMMENT '(DC2Type:json_array)', @@ -70,8 +70,9 @@ public function uninstall(ServiceLocatorInterface $serviceLocator) public function upgrade($oldVersion, $newVersion, ServiceLocatorInterface $serviceLocator) { + $connection = $serviceLocator->get('Omeka\Connection'); + if (version_compare($oldVersion, '1.1.1-rc.1', '<')) { - $connection = $serviceLocator->get('Omeka\Connection'); $sql = <<<'SQL' ALTER TABLE csvimport_import ADD stats LONGTEXT NOT NULL COMMENT '(DC2Type:json_array)'; UPDATE csvimport_import SET stats = CONCAT('{"processed":{"', resource_type, '":', added_count, '}}'); @@ -82,5 +83,9 @@ public function upgrade($oldVersion, $newVersion, ServiceLocatorInterface $servi $connection->exec($sql); } } + + if (version_compare($oldVersion, '2.6.3', '<')) { + $connection->executeStatement('ALTER TABLE csvimport_import MODIFY comment LONGTEXT NOT NULL'); + } } } diff --git a/config/module.ini b/config/module.ini index 4a035b55..1cc140b1 100644 --- a/config/module.ini +++ b/config/module.ini @@ -8,5 +8,5 @@ author_link = "https://omeka.org/" module_link = "https://omeka.org/s/docs/user-manual/modules/csvimport/" support_link = "https://forum.omeka.org/c/omeka-s/modules" configurable = false -version = "2.6.2" +version = "2.6.3" omeka_version_constraint = "^4.0.0" diff --git a/src/Entity/CSVImportImport.php b/src/Entity/CSVImportImport.php index 32114856..56251992 100644 --- a/src/Entity/CSVImportImport.php +++ b/src/Entity/CSVImportImport.php @@ -29,7 +29,7 @@ class CSVImportImport extends AbstractEntity protected $undoJob; /** - * @Column(type="string", nullable=true) + * @Column(type="text", nullable=true) */ protected $comment; From dab117a6b18db5beebfc80a98740497c19f0bf92 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 27 Feb 2026 09:05:55 +0100 Subject: [PATCH 2/2] Fix csvimport_import.comment definition in upgrade method --- Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Module.php b/Module.php index 51ac2058..54226b32 100644 --- a/Module.php +++ b/Module.php @@ -85,7 +85,7 @@ public function upgrade($oldVersion, $newVersion, ServiceLocatorInterface $servi } if (version_compare($oldVersion, '2.6.3', '<')) { - $connection->executeStatement('ALTER TABLE csvimport_import MODIFY comment LONGTEXT NOT NULL'); + $connection->executeStatement('ALTER TABLE csvimport_import MODIFY comment LONGTEXT DEFAULT NULL'); } } }