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
27af98b0
Commit
27af98b0
authored
13 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#1162226
by mr.baileys: taxonomy_term_save() should document what is in a object.
parent
94f3f368
No related branches found
No related tags found
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/taxonomy/taxonomy.module
+26
-3
26 additions, 3 deletions
modules/taxonomy/taxonomy.module
with
26 additions
and
3 deletions
modules/taxonomy/taxonomy.module
+
26
−
3
View file @
27af98b0
...
@@ -532,12 +532,35 @@ function taxonomy_check_vocabulary_hierarchy($vocabulary, $changed_term) {
...
@@ -532,12 +532,35 @@ function taxonomy_check_vocabulary_hierarchy($vocabulary, $changed_term) {
}
}
/**
/**
* Save a term object to the database.
* Save
s
a term object to the database.
*
*
* @param $term
* @param $term
* A term object.
* The taxonomy term object with the following properties:
* - vid: The ID of the vocabulary the term is assigned to.
* - name: The name of the term.
* - tid: (optional) The unique ID for the term being saved. If $term->tid is
* empty or omitted, a new term will be inserted.
* - description: (optional) The term's description.
* - format: (optional) The text format for the term's description.
* - weight: (optional) The weight of this term in relation to other terms
* within the same vocabulary.
* - parent: (optional) The parent term(s) for this term. This can be a single
* term ID or an array of term IDs. A value of 0 means this term does not
* have any parents. When omitting this variable during an update, the
* existing hierarchy for the term remains unchanged.
* - vocabulary_machine_name: (optional) The machine name of the vocabulary
* the term is assigned to. If not given, this value will be set
* automatically by loading the vocabulary based on $term->vid.
* - original: (optional) The original taxonomy term object before any changes
* were applied. When omitted, the unchanged taxonomy term object is
* loaded from the database and stored in this property.
* Since a taxonomy term is an entity, any fields contained in the term object
* are saved alongside the term object.
*
* @return
* @return
* Status constant indicating if term was inserted or updated.
* Status constant indicating whether term was inserted (SAVED_NEW) or updated
* (SAVED_UPDATED). When inserting a new term, $term->tid will contain the
* term ID of the newly created term.
*/
*/
function
taxonomy_term_save
(
$term
)
{
function
taxonomy_term_save
(
$term
)
{
// Prevent leading and trailing spaces in term names.
// Prevent leading and trailing spaces in term names.
...
...
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