Skip to content

Commit

Permalink
Released version 3.4.29.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Oct 30, 2023
1 parent e8107a4 commit fea5b55
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/module.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ author_link = "https://gitlab.com/Daniel-KM"
module_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-BulkExport"
support_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-BulkExport/issues"
configurable = false
version = "3.4.28"
version = "3.4.29"
omeka_version_constraint = "^4.0.0"
dependencies = "Log"
117 changes: 117 additions & 0 deletions data/scripts/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,120 @@
);
$messenger->addSuccess($message);
}

if (version_compare($oldVersion, '3.4.29', '<')) {
// TODO Fix upgrade for annotation body and target (but not yet used anyway).
$sql = <<<'SQL'
UPDATE `bulk_export`
SET
`params` =
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
REPLACE(
`params`,
'"o:item[o:id]"',
'"o:item/o:id"'
),
'"o:item[dcterms:identifier]"',
'"o:item/dcterms:identifier"'
),
'"o:item[dcterms:title]"',
'"o:item/dcterms:title"'
),
'"o:item_set[o:id]"',
'"o:item_set/o:id"'
),
'"o:item_set[dcterms:identifier]"',
'"o:item_set/dcterms:identifier"'
),
'"o:item_set[dcterms:title]"',
'"o:item_set/dcterms:title"'
),
'"o:media[o:id]"',
'"o:media/o:id"'
),
'"o:media[file]"',
'"o:media/file"'
),
'"o:media[source]"',
'"o:media/o:source"'
),
'"o:media[dcterms:identifier]"',
'"o:media/dcterms:identifier"'
),
'"o:media[dcterms:title]"',
'"o:media/dcterms:title"'
),
'"o:media[url]"',
'"o:media/url"'
),
'"o:media[media_type]"',
'"o:media/o:media_type"'
),
'"o:media[size]"',
'"o:media/o:size"'
),
'"o:media[original_url]"',
'"o:media/original_url"'
),
'"o:resource[o:id]"',
'"o:resource/o:id"'
),
'"o:resource[dcterms:identifier]"',
'"o:resource/dcterms:identifier"'
),
'"o:resource[dcterms:title]"',
'"o:resource/dcterms:title"'
),
'"o:owner[o:id]"',
'"o:owner/o:id"'
),
'"o:owner[o:email]"',
'"o:owner/o:email"'
),
'"oa:hasBody[',
'"oa:hasBody/'
),
'"oa:hasTarget[',
'"oa:hasTarget/'
)
;
SQL;
$connection->executeStatement($sql);

$replace = [
'`bulk_export`' => '`bulk_exporter`',
'`params`' => '`config`',
];
$connection->executeStatement(str_replace(array_keys($replace), array_values($replace), $sql));

$message = new Message(
'The config of exporters has been upgraded to a new format. You may check them if you use a complex config.' // @translate
);
$messenger->addSuccess($message);
}

0 comments on commit fea5b55

Please sign in to comment.