Skip to content
Extraits de code Groupes Projets
Valider 6d5d3d2e rédigé par RealET's avatar RealET :kissing_cat:
Parcourir les fichiers

Pour que les mots clefs s'installent sous SQLite, ne pas passer un id_group ou id_mot string vide !

3 warnings en moins
parent c36f7e55
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -133,7 +133,10 @@ function id_groupe($titre) { ...@@ -133,7 +133,10 @@ function id_groupe($titre) {
$titre = sql_quote($titre); $titre = sql_quote($titre);
spip_log("1. (id_groupe) selection dans la table spip_groupes_mots de l'id de : $titre", _LOG_DEBUG); spip_log("1. (id_groupe) selection dans la table spip_groupes_mots de l'id de : $titre", _LOG_DEBUG);
$result = sql_fetsel("id_groupe", "spip_groupes_mots", "titre=$titre"); $result = sql_fetsel("id_groupe", "spip_groupes_mots", "titre=$titre");
$resultat = $result['id_groupe']; $resultat = 0;
if ($result !== false) {
$resultat = $result['id_groupe'];
}
spip_log("2. (id_groupe) selection = $resultat pour $titre", _LOG_DEBUG); spip_log("2. (id_groupe) selection = $resultat pour $titre", _LOG_DEBUG);
return $resultat; return $resultat;
} }
...@@ -144,7 +147,6 @@ function create_groupe($groupe, $descriptif='', $texte='', $unseul='non', $oblig ...@@ -144,7 +147,6 @@ function create_groupe($groupe, $descriptif='', $texte='', $unseul='non', $oblig
spip_log("1. (create_groupe) pret a creer groupe : titre = $groupe. retour de find_groupe = $id_groupe", _LOG_DEBUG); spip_log("1. (create_groupe) pret a creer groupe : titre = $groupe. retour de find_groupe = $id_groupe", _LOG_DEBUG);
if ($id_groupe == 0) { if ($id_groupe == 0) {
$set = array( $set = array(
"id_groupe" => '',
"titre" => $groupe, "titre" => $groupe,
"descriptif" => $descriptif, "descriptif" => $descriptif,
"texte" => $texte, "texte" => $texte,
...@@ -237,7 +239,6 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') { ...@@ -237,7 +239,6 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') {
if ($find_mot == 0) { if ($find_mot == 0) {
spip_log("1. (create_mot) debut create_mot. mot inexistant donc creation : $id_groupe - $mot", _LOG_DEBUG); spip_log("1. (create_mot) debut create_mot. mot inexistant donc creation : $id_groupe - $mot", _LOG_DEBUG);
$set = array( $set = array(
"id_mot" => '',
"titre" => $mot, "titre" => $mot,
"descriptif" => $descriptif, "descriptif" => $descriptif,
"texte" => $texte, "texte" => $texte,
...@@ -564,7 +565,10 @@ function create_encart($titre, $identifiant, $largeur=0, $hauteur=0) { ...@@ -564,7 +565,10 @@ function create_encart($titre, $identifiant, $largeur=0, $hauteur=0) {
"spip_encarts", "spip_encarts",
"identifiant=" . sql_quote($identifiant) "identifiant=" . sql_quote($identifiant)
); );
$id_encart = $result['id_encart']; $id_encart = 0;
if ($result !== false) {
$id_encart = $result['id_encart'];
}
$set = array( $set = array(
"titre" => $titre, "titre" => $titre,
"identifiant" => $identifiant, "identifiant" => $identifiant,
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
</ul> </ul>
<?php <?php
if ($retours) { if (isset($retours) AND $retours) {
$ok = $retours['message_erreur']; $ok = isset($retours['message_erreur']) ? $retours['message_erreur'] : '';
if (!$ok) { if (!$ok) {
$ok = '<a href="' . $retours['redirect'] . '">' . $retours['redirect'] . '</a>'; $ok = '<a href="' . $retours['redirect'] . '">' . $retours['redirect'] . '</a>';
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter