diff --git a/blocks_fonctions.php b/blocks_fonctions.php index 9d59a977ca89d5c0e39856b8a6d97d345eecfd6d..2e473c9eb68e810d5d455926f053bfaf3dc0b6e8 100644 --- a/blocks_fonctions.php +++ b/blocks_fonctions.php @@ -159,14 +159,18 @@ function _block_charger_block($id_bloc) { * @return mixed|string */ function generer_TITRE_BLOC($id_bloc){ - $infos = sql_fetsel( + if($infos = sql_fetsel( 'bt.titre, bl.objet, bl.rang_lien, bl.id_objet', 'spip_blocs b join spip_blocs_types bt using(id_blocs_type) left join spip_blocs_liens bl using(id_bloc)', 'b.id_bloc = '.(int)$id_bloc - ); - $titre = $infos['titre']; - if($infos['id_objet'] && $infos['objet']) { - $titre = generer_objet_info($infos['id_objet'], $infos['objet'], 'titre') . ' - ' . $titre . ' #' . $infos['rang_lien']; + )) { + $titre = $infos['titre']; + if ($infos['id_objet'] && $infos['objet']) { + $titre = generer_objet_info($infos['id_objet'], $infos['objet'], 'titre') . ' - ' . $titre . ' #' . $infos['rang_lien']; + } + } else { + $titre = _T('bloc:titre_bloc').' '.$id_bloc; } + return $titre; }