Quick links: Content - sections - sub sections
EN FR
Quick Search Advanced search
 
Page

  [Opened] url significatives et form

Posted by Loran on 01/26/2008 11:45

Bonjour,

Je suis nouveau sur le forum mais utilisateur de Jelix depuis 9 mois.

Voici mon problème :

J'utilise les url significatives et le Mod_rewrite pour le parsing en entrée. Le problème est lorsque je veux afficher le formulaire, j'ai ce message :

 [error 0] Significant url engine doesn't find corresponding url to this action :common~contactForm:save@classic

Cela correspond à l'action du template de formulaire :

   {formfull $form, 'common~contactForm:save'}

En faisant d'autres tests, j'ai constaté que ce problème existe lorsque pour les url simples (que j'utilise pour les formulaires) je n'ai pas d'entrée dans le fichier urls.xml. Ceci est également vrai pour des réponses de type "redirect".

J'avais contourné le problème en créant une entrée dans urls.xml pour chaque adresse url "simple" mais en essayant de migrer vers jelix 1.01, le nouveau séparateur controleur:méthode dans les urls pose problème (car utilisé pour identifier une variable).

Voici ma configuration :

Le point d'entrée index.php est à la racine du serveur, l'application est dans un répertoire protégé.

 [compilation]
 checkCacheFiletime=1
 force=
 [urlengine]
 engine=significant
 enableParser=
 multiview=
 scriptNameServerVariable=SCRIPT_NAME
 basePath="/"
 jelixWWWPath="/jwww/"
 defaultEntrypoint=index
 entrypointExtension=".php"
 

Es-ce normal ? Quelle est la meilleure solution pour contourner cette difficulté ?

Merci de votre aide

  [Opened] Re: url significatives et form

Reply #1 Posted by laurentj on 01/26/2008 13:40

Salut,

Pourrais-tu nous montrer ton fichier urls.xml ? Et puis aussi tes rêgles mod_rewrite.

le nouveau séparateur controleur:méthode dans les urls pose problème (car utilisé pour identifier une variable).

Je ne vois pas le rapport là. Tu veux dire que tu met des noms de sélecteurs dans le nom de l'url ?

  [Opened] Re: url significatives et form

Reply #2 Posted by Loran on 01/26/2008 22:20

Si je prends exemple sur le formulaire contact, l'affichage se fait via rewriting :

 RewriteRule go/contact.htm index.php?module=common&action=contactForm_show&%{QUERY_STRING}

et le fichier urls.xml

    <classicentrypoint  noentrypoint="true"  > 
     <url pathinfo="/go/contact.htm" module="common" action="contactForm_show">
      </url>
     </classicentrypoint>  

Mais lorsque le formulaire est posté, si je ne fais pas

  <url pathinfo="/index.php?module=common&amp;action=contactForm_save" module="common" action="contactForm_save">
        </url> 

Cela ne fonctionne pas.

Et avec jelix 1.01 :

 <url pathinfo="/index.php?module=common&amp;action=contactForm:save" module="common" action="contactForm:save">
        </url> 

cela ne fonctionne non plus comme ça...

Voici le fichier urls.xml en entier(avant migration jelix 1.01):

 <urls xmlns="http://jelix.org/ns/urls/1.0">
 <classicentrypoint noentrypoint="true">
 <url pathinfo="/:targetedTopic.htm" module="WebSiteSection" action="default_show">
  <param name="targetedTopic" regexp="\d+" escape="true" /> 
  </url>
  <url pathinfo="/:targetedTopic/actualites.htm" module="NewsSection" action="default_show" /> 
  <url pathinfo="/go/search.htm" module="common" action="search_getSearch" /> 
  <url pathinfo="/go/submit.htm" module="common" action="submitSite_show" /> 
  <url pathinfo="/index.php?module=common&action=submitSite_show" module="common" action="submitSite_show" /> 
  <url pathinfo="/index.php?module=common&action=submitSite_save" module="common" action="submitSite_save" /> 
  <url pathinfo="/index.php?module=common&action=submitSite_ok" module="common" action="submitSite_ok" /> 
  <url pathinfo="/general/techno.htm" module="common" action="default_getPresentationTechno" /> 
  <url pathinfo="/general/conditions-utilisation.htm" module="common" action="default_getConditionsUtilisation" /> 
  <url pathinfo="/go/contact.htm" module="common" action="contactForm_show" /> 
  <url pathinfo="/index.php?module=common&action=contactForm_show" module="common" action="contactForm_show" /> 
  <url pathinfo="/index.php?module=common&action=contactForm_save" module="common" action="contactForm_save" /> 
  <url pathinfo="/index.php?module=common&action=contactForm_ok" module="common" action="contactForm_ok" /> 
  <url pathinfo="/go/reco.htm" module="common" action="recoForm_show" /> 
  <url pathinfo="/index.php?module=common&action=recoForm_show" module="common" action="recoForm_show" /> 
  <url pathinfo="/index.php?module=common&action=recoForm_save" module="common" action="recoForm_save" /> 
  <url pathinfo="/index.php?module=common&action=recoForm_ok" module="common" action="recoForm_ok" /> 
  <url pathinfo="/go/autocomplete.htm" module="common" action="search_autocompleter" /> 
  <url pathinfo="/" module="common" action="default_index" /> 
  <url pathinfo="/index.php?module=common&action=tree_index" module="common" action="tree_index" /> 
  </classicentrypoint>
  </urls>

  [Opened] Re: url significatives et form

Reply #3 Posted by Loran on 01/27/2008 11:08

Ok merci de ton aide, je revois tout ça.

  [Opened] [Résolu] url significatives et form

Reply #4 Posted by Loran on 01/27/2008 11:56

Cela venait effectivement de ça :

 <classicentrypoint name="index" default="true" noentrypoint="true">

Maintenant c'est bon, merci bcp (pour le .htm, des vieilles habitudes d'années de programmation web...).

 
Page
  1. [Résolu] url significatives et form