Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
e1c40673
Commit
e1c40673
authored
11 years ago
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2078837
by alexpott: Fixed Ensure that we are using SQL storage for taxonomy_update_8007().
parent
de0492e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/file/file.install
+27
-25
27 additions, 25 deletions
core/modules/file/file.install
core/modules/taxonomy/taxonomy.install
+23
-21
23 additions, 21 deletions
core/modules/taxonomy/taxonomy.install
with
50 additions
and
46 deletions
core/modules/file/file.install
+
27
−
25
View file @
e1c40673
...
@@ -309,35 +309,37 @@ function file_update_8003() {
...
@@ -309,35 +309,37 @@ function file_update_8003() {
if
(
in_array
(
$field_config
->
get
(
'type'
),
array
(
'file'
,
'image'
)))
{
if
(
in_array
(
$field_config
->
get
(
'type'
),
array
(
'file'
,
'image'
)))
{
$field
=
new
Field
(
$field_config
->
get
());
$field
=
new
Field
(
$field_config
->
get
());
$tables
=
array
(
if
(
db_table_exists
(
DatabaseStorageController
::
_fieldTableName
(
$field
)))
{
DatabaseStorageController
::
_fieldTableName
(
$field
),
$tables
=
array
(
DatabaseStorageController
::
_fieldRevisionTableName
(
$field
),
DatabaseStorageController
::
_fieldTableName
(
$field
),
);
DatabaseStorageController
::
_fieldRevisionTableName
(
$field
),
);
foreach
(
$tables
as
$table_name
)
{
foreach
(
$tables
as
$table_name
)
{
// Skip fields which were created during the upgrade process.
// Skip fields which were created during the upgrade process.
if
(
!
db_field_exists
(
$table_name
,
$field
->
name
.
'_fid'
))
{
if
(
!
db_field_exists
(
$table_name
,
$field
->
name
.
'_fid'
))
{
continue
2
;
continue
2
;
}
}
db_change_field
(
$table_name
,
$field
->
name
.
'_fid'
,
$field
->
name
.
'_target_id'
,
array
(
db_change_field
(
$table_name
,
$field
->
name
.
'_fid'
,
$field
->
name
.
'_target_id'
,
array
(
'description'
=>
'The ID of the target entity.'
,
'description'
=>
'The ID of the target entity.'
,
'type'
=>
'int'
,
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'unsigned'
=>
TRUE
,
'not null'
=>
TRUE
,
'not null'
=>
TRUE
,
));
));
// Change the index.
// Change the index.
db_drop_index
(
$table_name
,
$field
->
name
.
'_fid'
);
db_drop_index
(
$table_name
,
$field
->
name
.
'_fid'
);
db_add_index
(
$table_name
,
$field
->
name
.
'_target_id'
,
array
(
$field
->
name
.
'_target_id'
));
db_add_index
(
$table_name
,
$field
->
name
.
'_target_id'
,
array
(
$field
->
name
.
'_target_id'
));
}
}
// Update the indexes in field config as well.
// Update the indexes in field config as well.
$indexes
=
$field_config
->
get
(
'indexes'
);
$indexes
=
$field_config
->
get
(
'indexes'
);
unset
(
$indexes
[
'fid'
]);
unset
(
$indexes
[
'fid'
]);
$indexes
[
'target_id'
]
=
array
(
'target_id'
);
$indexes
[
'target_id'
]
=
array
(
'target_id'
);
$field_config
->
set
(
'indexes'
,
$indexes
);
$field_config
->
set
(
'indexes'
,
$indexes
);
$field_config
->
save
();
$field_config
->
save
();
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
core/modules/taxonomy/taxonomy.install
+
23
−
21
View file @
e1c40673
...
@@ -364,30 +364,32 @@ function taxonomy_update_8007() {
...
@@ -364,30 +364,32 @@ function taxonomy_update_8007() {
if
(
$field_config
->
get
(
'type'
)
==
'taxonomy_term_reference'
)
{
if
(
$field_config
->
get
(
'type'
)
==
'taxonomy_term_reference'
)
{
$field
=
new
Field
(
$field_config
->
get
());
$field
=
new
Field
(
$field_config
->
get
());
$tables
=
array
(
if
(
db_table_exists
(
DatabaseStorageController
::
_fieldTableName
(
$field
)))
{
DatabaseStorageController
::
_fieldTableName
(
$field
),
$tables
=
array
(
DatabaseStorageController
::
_fieldRevisionTableName
(
$field
),
DatabaseStorageController
::
_fieldTableName
(
$field
),
);
DatabaseStorageController
::
_fieldRevisionTableName
(
$field
),
);
foreach
(
$tables
as
$table_name
)
{
foreach
(
$tables
as
$table_name
)
{
db_change_field
(
$table_name
,
$field
->
name
.
'_tid'
,
$field
->
name
.
'_target_id'
,
array
(
db_change_field
(
$table_name
,
$field
->
name
.
'_tid'
,
$field
->
name
.
'_target_id'
,
array
(
'description'
=>
'The ID of the target entity.'
,
'description'
=>
'The ID of the target entity.'
,
'type'
=>
'int'
,
'type'
=>
'int'
,
'unsigned'
=>
TRUE
,
'unsigned'
=>
TRUE
,
'not null'
=>
FALSE
,
'not null'
=>
FALSE
,
));
));
// Change the index.
// Change the index.
db_drop_index
(
$table_name
,
$field
->
name
.
'_tid'
);
db_drop_index
(
$table_name
,
$field
->
name
.
'_tid'
);
db_add_index
(
$table_name
,
$field
->
name
.
'_target_id'
,
array
(
$field
->
name
.
'_target_id'
));
db_add_index
(
$table_name
,
$field
->
name
.
'_target_id'
,
array
(
$field
->
name
.
'_target_id'
));
}
}
// Update the indexes in field config as well.
// Update the indexes in field config as well.
$indexes
=
$field_config
->
get
(
'indexes'
);
$indexes
=
$field_config
->
get
(
'indexes'
);
unset
(
$indexes
[
'tid'
]);
unset
(
$indexes
[
'tid'
]);
$indexes
[
'target_id'
]
=
array
(
'target_id'
);
$indexes
[
'target_id'
]
=
array
(
'target_id'
);
$field_config
->
set
(
'indexes'
,
$indexes
);
$field_config
->
set
(
'indexes'
,
$indexes
);
$field_config
->
save
();
$field_config
->
save
();
}
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment