YesWiki/yeswiki

title in bazar form has bad behavior

oiseauroch opened this issue · 3 comments

Type of issue (keep only one) / Type de demande (ne garder qu'une ligne)
Bug / Bogue

Description
Title in bazar forms seems to not be good handeld. I found 2 problems : 

  1. Using a title without a value lead to the following error : 
Une erreur inattendue s'est produite. Veuillez contacter l'administrateur du site et lui communiquer l'erreur suivante :
$data['id_fiche'] is set but with empty value ! in /var/www/yeswiki/tools/bazar/services/EntryManager.php on line 795

It seems that the function genere_nom_wiki($data['bf_titre'] look for the value of the title instead of getting the value of the field bf_titre. Setting a value to the title allow creating sheet but title of the sheet is the title, not the field with bf_titre.

wiki code causing this bug : 

texte***bf_titre***Titre de la fiche*** *** ***bug title*** ***text***1*** *** *** * *** * *** *** *** ***
titre*** ***important title***
texte***bf_text***Texte court*** *** ***hello*** ***text***0*** *** *** * *** * *** *** *** ***
titre*** ***Titre Automatique***
  1. Using several titles with several values display always the same value when displaying the sheet : 

wiki code causing this bug : 

texte***bf_titre***Titre de la fiche*** *** ***bug title*** ***text***1*** *** *** * *** * *** *** *** ***
titre***my first title***first title***
texte***bf_text***Texte court*** *** ***hello*** ***text***0*** *** *** * *** * *** *** *** ***
titre***my second title***second title***

title_error

Additionnal informations / Informations complémentaires

  • version : 4.3.1 (bug also found with last doryphore-dev commit)

it's not a bug, it's a feature... ..kinda..
In your bazar form, you should choose between using a field with id 'bf_title', or using the component called 'titre' (but only once per form)
If you are using a field 'bf_titre', it should be required and the input will be used for generating the entries PageTag.
If you are using the 'titre' componant you can either give a generic title to the entry, or use tokens like "Contribution of {{bf_prenom}} {{bf_nom}}".
But we should avoid the use of component 'titre' if a field named 'bf_titre' exists or if another component 'titre' is already there

Ok sound clear now.
I tried to use it as title to separate part of my form

you can use html field with <h2>my title</h2> for this use case