Skip to content
Snippets Groups Projects
Commit e5e26a07 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #7302 by Gerhard: saves the selected terms in a session variable.

parent cf98e0a1
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -603,6 +603,14 @@ function taxonomy_get_term($tid) {
function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $description, $multiple, $blank, $exclude = array()) {
$tree = taxonomy_get_tree($vocabulary_id);
// We store the last selected ID in a session variable:
if (!$value) {
$value = $_SESSION['vocabulary']["$vocabulary_id"];
}
else {
$_SESSION['vocabulary']["$vocabulary_id"] = $value;
}
if ($blank) {
$options[] = array("tid" => 0, "name" => $blank);
}
......
......@@ -603,6 +603,14 @@ function taxonomy_get_term($tid) {
function _taxonomy_term_select($title, $name, $value, $vocabulary_id, $description, $multiple, $blank, $exclude = array()) {
$tree = taxonomy_get_tree($vocabulary_id);
// We store the last selected ID in a session variable:
if (!$value) {
$value = $_SESSION['vocabulary']["$vocabulary_id"];
}
else {
$_SESSION['vocabulary']["$vocabulary_id"] = $value;
}
if ($blank) {
$options[] = array("tid" => 0, "name" => $blank);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment