Skip to content

Commit

Permalink
MetaData: also set description of unmigrated all rights reserved (41301)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmitz-ilias committed Jan 31, 2025
1 parent 7daccea commit 6039177
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Services/MetaData/classes/Setup/class.ilMDCopyrightUpdateSteps.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,29 @@ public function step_11(): void
}
}
}

/**
* Also change description of unmigrated 'All rights reserved',
* see https://mantis.ilias.de/view.php?id=41301
*/
public function step_12(): void
{
$title = "All rights reserved";
$old_copyright = "This work has all rights reserved by the owner.";
$new_description = "The copyright holder reserves, or holds for their own use, all the rights provided by copyright law.";

$res = $this->db->query(
'SELECT entry_id FROM il_md_cpr_selections WHERE title = ' .
$this->db->quote($title, ilDBConstants::T_TEXT) . ' AND copyright = ' .
$this->db->quote($old_copyright, ilDBConstants::T_TEXT) .
" AND COALESCE(description, '') = ''"
);
if (($row = $this->db->fetchAssoc($res)) && isset($row['entry_id'])) {
$this->db->update(
'il_md_cpr_selections',
['description' => [\ilDBConstants::T_TEXT, $new_description]],
['entry_id' => [\ilDBConstants::T_INTEGER, $row['entry_id']]]
);
}
}
}

0 comments on commit 6039177

Please sign in to comment.