30 $this->db->manipulate(
"UPDATE il_dcl_tableview " .
31 "SET description=" . $this->db->quote(
"",
"text") .
32 "WHERE description is null");
33 $this->db->modifyTableColumn(
"il_dcl_tableview",
"description", [
'notnull' =>
true,
39 $this->db->manipulate(
"UPDATE il_dcl_tview_set " .
41 "WHERE in_filter is null");
42 $this->db->manipulate(
"UPDATE il_dcl_tview_set " .
44 "WHERE visible is null");
45 $this->db->manipulate(
"UPDATE il_dcl_tview_set " .
46 "SET filter_changeable=0 " .
47 "WHERE filter_changeable is null");
48 $this->db->modifyTableColumn(
"il_dcl_tview_set",
"in_filter", [
'notnull' =>
true,
50 $this->db->modifyTableColumn(
"il_dcl_tview_set",
"visible", [
'notnull' =>
true,
52 $this->db->modifyTableColumn(
"il_dcl_tview_set",
"filter_changeable", [
'notnull' =>
true,
58 $this->db->manipulate(
"UPDATE il_dcl_tfield_set " .
60 "WHERE exportable is null");
61 $this->db->modifyTableColumn(
"il_dcl_tfield_set",
"exportable", [
'notnull' =>
true,
67 $this->db->modifyTableColumn(
"il_dcl_stloc3_value",
"value", [
'notnull' =>
false]);
72 if (!$this->db->indexExistsByFields(
'il_dcl_field_prop', array(
'id',
'field_id'))) {
73 $this->db->addIndex(
'il_dcl_field_prop', array(
'id',
'field_id'),
'i1');
75 if (!$this->db->indexExistsByFields(
'il_dcl_tview_set', array(
'tableview_id'))) {
76 $this->db->addIndex(
'il_dcl_tview_set', array(
'tableview_id'),
'i1');
82 $this->db->modifyTableColumn(
93 if (!$this->db->indexExistsByFields(
'il_dcl_field_prop', array(
'field_id'))) {
94 $this->db->addIndex(
'il_dcl_field_prop', array(
'field_id'),
'i2');
96 if (!$this->db->indexExistsByFields(
'il_dcl_sel_opts', array(
'field_id'))) {
97 $this->db->addIndex(
'il_dcl_sel_opts', array(
'field_id'),
'i1');
99 if (!$this->db->indexExistsByFields(
'il_dcl_sel_opts', array(
'opt_id'))) {
100 $this->db->addIndex(
'il_dcl_sel_opts', array(
'opt_id'),
'i2');
102 if (!$this->db->indexExistsByFields(
'il_dcl_tview_set', array(
'field'))) {
103 $this->db->addIndex(
'il_dcl_tview_set', array(
'field'),
'i2');
105 if (!$this->db->indexExistsByFields(
'il_dcl_tview_set', array(
'in_filter'))) {
106 $this->db->addIndex(
'il_dcl_tview_set', array(
'in_filter'),
'i3');
108 if (!$this->db->indexExistsByFields(
'il_dcl_tfield_set', array(
'field'))) {
109 $this->db->addIndex(
'il_dcl_tfield_set', array(
'field'),
'i3');
111 if (!$this->db->indexExistsByFields(
'il_dcl_tfield_set', array(
'table_id'))) {
112 $this->db->addIndex(
'il_dcl_tfield_set', array(
'table_id'),
'i4');
118 $this->db->manipulateF(
119 'UPDATE il_dcl_field_prop prop INNER JOIN il_dcl_field field ON field.id = prop.field_id ' .
120 'SET name = "link_detail_page_text" WHERE field.datatype_id = %s AND name = "link_detail_page"',
124 $this->db->manipulateF(
125 'UPDATE il_dcl_field_prop prop INNER JOIN il_dcl_field field ON field.id = prop.field_id ' .
126 'SET name = "link_detail_page_mob" WHERE field.datatype_id = %s AND name = "link_detail_page"',
134 $this->db->manipulateF(
135 'UPDATE il_dcl_stloc1_value v ' .
136 'INNER JOIN il_dcl_record_field rf ON rf.id = v.record_field_id ' .
137 'INNER JOIN il_dcl_field f ON f.id = rf.field_id ' .
138 'SET v.value = REPLACE(v.value, "<br />", "\r\n") WHERE f.datatype_id = %s',
146 $this->db->manipulate(
'UPDATE il_dcl_field_prop SET value = "" WHERE value IS NULL');
151 if ($this->db->tableExists(
'il_dcl_field_prop_b')) {
152 $this->db->dropTable(
'il_dcl_field_prop_b');
155 if ($this->db->tableExists(
'il_dcl_field_prop_s_b')) {
156 $this->db->dropTable(
'il_dcl_field_prop_s_b');
164 foreach ($slot->getPlugins() as
$plugin) {
169 $stmt = $this->db->queryF(
170 'SELECT field_id FROM il_dcl_field_prop WHERE name = "plugin_hook_name" AND value = %s',
174 while ($row = $this->db->fetchAssoc($stmt)) {
175 $field_ids[] = (
int) $row[
'field_id'];
179 $stmt = $this->db->queryF(
'SELECT id FROM il_dcl_datatype WHERE title LIKE %s', [
ilDBConstants::T_TEXT], [$field_type_name]);
180 while ($row = $this->db->fetchAssoc($stmt)) {
185 $field_model_class =
'il' .
$plugin->getPluginName() .
'FieldModel';
186 $type = (
new $field_model_class())->getStorageLocationOverride() ??
$plugin->getStorageLocation();
188 $this->db->manipulateF(
189 'INSERT INTO il_dcl_datatype (id, title, ildb_type, storage_location, sort) SELECT GREATEST(MAX(id), 1000) + 1, %s, %s, %s, GREATEST(MAX(sort), 10000) + 10 FROM il_dcl_datatype;',
201 $stmt = $this->db->queryF(
'SELECT id FROM il_dcl_datatype WHERE title LIKE %s', [
ilDBConstants::T_TEXT], [$field_type_name]);
202 $id = (
int) $this->db->fetchAssoc($stmt)[
'id'];
205 foreach ($field_ids as $field_id) {
206 $this->db->manipulateF(
207 'UPDATE il_dcl_field SET datatype_id = %s WHERE id = %s',
213 $this->db->manipulateF(
214 'DELETE FROM il_dcl_field_prop WHERE name = "plugin_hook_name" AND value = %s',
219 $this->db->manipulateF(
220 'DELETE FROM il_dcl_datatype WHERE id = %s',
230 if ($row = $this->db->fetchAssoc($stmt)) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getDataType(string $plugin_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
prepare(ilDBInterface $db)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...