Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
167cf56a
Commit
167cf56a
authored
May 10, 2003
by
Dries
Browse files
- Fixed warning when creating a vocabulary with no types. Reported by Gerhard, patch by Marco.
parent
a31c3297
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/taxonomy.module
View file @
167cf56a
...
...
@@ -93,7 +93,11 @@ function taxonomy_form_vocabulary($edit = array()) {
}
function
taxonomy_save_vocabulary
(
$edit
)
{
$data
=
array
(
"name"
=>
$edit
[
"name"
],
"types"
=>
@
implode
(
","
,
$edit
[
"types"
]),
"description"
=>
$edit
[
"description"
],
"multiple"
=>
$edit
[
"multiple"
],
"required"
=>
$edit
[
"required"
],
"hierarchy"
=>
$edit
[
"hierarchy"
],
"relations"
=>
$edit
[
"relations"
],
"weight"
=>
$edit
[
"weight"
]);
if
(
!
$edit
[
"types"
])
{
$edit
[
"types"
]
=
array
();
}
$data
=
array
(
"name"
=>
$edit
[
"name"
],
"types"
=>
implode
(
","
,
$edit
[
"types"
]),
"description"
=>
$edit
[
"description"
],
"multiple"
=>
$edit
[
"multiple"
],
"required"
=>
$edit
[
"required"
],
"hierarchy"
=>
$edit
[
"hierarchy"
],
"relations"
=>
$edit
[
"relations"
],
"weight"
=>
$edit
[
"weight"
]);
if
(
$edit
[
"vid"
]
&&
$edit
[
"name"
])
{
db_query
(
"UPDATE vocabulary SET "
.
_prepare_update
(
$data
)
.
" WHERE vid = %d"
,
$edit
[
"vid"
]);
module_invoke_all
(
"taxonomy"
,
"update"
,
"vocabulary"
,
$edit
);
...
...
modules/taxonomy/taxonomy.module
View file @
167cf56a
...
...
@@ -93,7 +93,11 @@ function taxonomy_form_vocabulary($edit = array()) {
}
function
taxonomy_save_vocabulary
(
$edit
)
{
$data
=
array
(
"name"
=>
$edit
[
"name"
],
"types"
=>
@
implode
(
","
,
$edit
[
"types"
]),
"description"
=>
$edit
[
"description"
],
"multiple"
=>
$edit
[
"multiple"
],
"required"
=>
$edit
[
"required"
],
"hierarchy"
=>
$edit
[
"hierarchy"
],
"relations"
=>
$edit
[
"relations"
],
"weight"
=>
$edit
[
"weight"
]);
if
(
!
$edit
[
"types"
])
{
$edit
[
"types"
]
=
array
();
}
$data
=
array
(
"name"
=>
$edit
[
"name"
],
"types"
=>
implode
(
","
,
$edit
[
"types"
]),
"description"
=>
$edit
[
"description"
],
"multiple"
=>
$edit
[
"multiple"
],
"required"
=>
$edit
[
"required"
],
"hierarchy"
=>
$edit
[
"hierarchy"
],
"relations"
=>
$edit
[
"relations"
],
"weight"
=>
$edit
[
"weight"
]);
if
(
$edit
[
"vid"
]
&&
$edit
[
"name"
])
{
db_query
(
"UPDATE vocabulary SET "
.
_prepare_update
(
$data
)
.
" WHERE vid = %d"
,
$edit
[
"vid"
]);
module_invoke_all
(
"taxonomy"
,
"update"
,
"vocabulary"
,
$edit
);
...
...
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