Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
link
Commits
5f09d06a
Commit
5f09d06a
authored
Apr 25, 2007
by
Nathan Haug
Browse files
Fixed upgrade script for single link fields. Issue #132440. Thanks budda!
parent
960ec8eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
link.install
link.install
+2
-2
No files found.
link.install
View file @
5f09d06a
...
...
@@ -33,13 +33,13 @@ function link_update_1() {
$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
(
'
INSERT INTO
{'
.
$db_info
[
'table'
]
.
'}
(vid, nid,
'
.
$field
[
'field_name'
]
.
'_url
,
'
.
$field
[
'field_name'
]
.
'_title
,
'
.
$field
[
'field_name'
]
.
"_attributes
) SELECT vid, nid, field_url, field_title, attributes FROM
{
node_field_link_data
}
WHERE field_name = '"
.
$field
[
'field_name'
]
.
"'"
);
$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
;
}
Write
Preview
Markdown
is supported
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