Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
link
Commits
3fcf556b
Commit
3fcf556b
authored
Sep 22, 2008
by
Nathan Haug
Browse files
#308868. Removing old update function that calls non-existant CCK functions.
parent
49036905
Changes
1
Hide whitespace changes
Inline
Side-by-side
link.install
View file @
3fcf556b
...
...
@@ -34,37 +34,8 @@ function link_disable() {
}
/**
*
Removed link.module created tables, move data to content.module tables
*
Implementation of hook_update_last_removed().
*/
function
link_update_1
()
{
$ret
=
array
();
include_once
(
drupal_get_path
(
'module'
,
'content'
)
.
'/content.module'
);
include_once
(
drupal_get_path
(
'module'
,
'content'
)
.
'/content_admin.inc'
);
$fields
=
content_fields
();
foreach
(
$fields
as
$field
)
{
switch
(
$field
[
'type'
])
{
case
'link'
:
$columns
=
array
(
'url'
=>
array
(
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
"''"
),
'title'
=>
array
(
'type'
=>
'varchar'
,
'length'
=>
255
,
'not null'
=>
TRUE
,
'default'
=>
"''"
),
'attributes'
=>
array
(
'type'
=>
'mediumtext'
,
'not null'
=>
FALSE
),
);
content_alter_db_field
(
array
(),
array
(),
$field
,
$columns
);
$db_info
=
content_database_info
(
$field
);
if
(
$field
[
'multiple'
])
{
$ret
[]
=
update_sql
(
'INSERT INTO {'
.
$db_info
[
'table'
]
.
'} (vid, delta, nid, '
.
$field
[
'field_name'
]
.
'_url, '
.
$field
[
'field_name'
]
.
'_title, '
.
$field
[
'field_name'
]
.
"_attributes) SELECT vid, delta, nid, field_url, field_title, attributes FROM
{
node_field_link_data
}
WHERE field_name = '"
.
$field
[
'field_name'
]
.
"'"
);
}
else
{
$ret
[]
=
update_sql
(
'UPDATE {'
.
$db_info
[
'table'
]
.
'} c, {node_field_link_data} l SET c.'
.
$field
[
'field_name'
]
.
'_url = l.field_url, c.'
.
$field
[
'field_name'
]
.
'_title = l.field_title, c.'
.
$field
[
'field_name'
]
.
"_attributes = l.attributes WHERE l.field_name = '"
.
$field
[
'field_name'
]
.
"' AND c.vid = l.vid AND c.nid = l.nid"
);
}
}
}
$ret
[]
=
update_sql
(
'DROP TABLE {node_field_link_data}'
);
db_query
(
'DELETE FROM {cache}'
);
return
$ret
;
function
system_update_last_removed
()
{
return
1
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment