salut tout le monde,
j'ai une probleme au niveau de ma boite de recherche, En faite sur la front-page, lorsque je veux lancer du recherche sur mon site, j'aurai des erreurs
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
Site Error
 
An error was encountered while publishing this resource.
 
KeyError
Sorry, a site error occurred.
 
Traceback (innermost last):
 
    * Module ZPublisher.Publish, line 188, in publish_module_standard
    * Module Products.PlacelessTranslationService.PatchStringIO, line 51, in new_publish
    * Module ZPublisher.Publish, line 145, in publish
    * Module Zope2.App.startup, line 222, in zpublisher_exception_hook
    * Module ZPublisher.Publish, line 114, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 40, in call_object
    * Module Shared.DC.Scripts.Bindings, line 311, in __call__
    * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
    * Module Products.CMFCore.FSPageTemplate, line 195, in _exec
    * Module Products.CMFCore.FSPageTemplate, line 134, in pt_render
    * Module Products.PageTemplates.PageTemplate, line 104, in pt_render
      <FSPageTemplate at /amairi/search>
    * Module TAL.TALInterpreter, line 238, in __call__
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 749, in do_useMacro
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 457, in do_optTag_tal
    * Module TAL.TALInterpreter, line 442, in do_optTag
    * Module TAL.TALInterpreter, line 437, in no_tag
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 715, in do_condition
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 715, in do_condition
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 691, in do_loop_tal
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 457, in do_optTag_tal
    * Module TAL.TALInterpreter, line 442, in do_optTag
    * Module TAL.TALInterpreter, line 437, in no_tag
    * Module TAL.TALInterpreter, line 281, in interpret
    * Module TAL.TALInterpreter, line 714, in do_condition
    * Module Products.PageTemplates.TALES, line 221, in evaluate
      URL: file:Asyres/skins/default/main_template.pt
      Line 118, Column 8
      Expression: <PythonExpr obj['portal_type']=='Folder' or obj['portal_type']=='Container' or obj['portal_type']=='ATFolder'>
      Names:
 
      {'container': <PloneSite at /amairi>,
       'context': <PloneSite at /amairi>,
       'default': <Products.PageTemplates.TALES.Default instance at 0xb75c732c>,
       'here': <PloneSite at /amairi>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0xb299340c>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0xb756a92c>,
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0xb299340c>,
       'request': <HTTPRequest, URL=http://localhost:8080/amairi/search>,
       'root': <Application at >,
       'template': <FSPageTemplate at /amairi/search>,
       'traverse_subpath': [],
       'user': <User 'admin'>}
 
    * Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
      __traceback_info__: obj['portal_type']=='Folder' or obj['portal_type']=='Container' or obj['portal_type']=='ATFolder'
    * Module Python expression "obj['portal_type']=='Folder' or obj['portal_type']=='Container' or obj['portal_type']=='ATFolder'", line 1, in <expression>
    * Module AccessControl.ZopeGuards, line 67, in guarded_getitem
    * Module OFS.ObjectManager, line 725, in __getitem__
 
KeyError: 'portal_type' (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: 'portal_type')
 
Troubleshooting Suggestions
 
    * The URL may be incorrect.
    * The parameters passed to this resource may be incorrect.
    * A resource that this resource relies on may be encountering an error.
 
For more detailed information about the error, please refer to error log.
 
If the error persists please contact the site maintainer. Thank you for your patience.
sachant, que ça marcher tres bien sur les autres pages (l'eurreur s'afficher que sur le front-page)
voila, le code qui provoquer l'erruer
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
<div class="blockMenu" tal:condition="python:here.getId() != 'search' and here.getId() != 'front-page'">
          <div tal:condition="python:here.getId() != 'focus'">
			<div class="titreBlockMenu" tal:define="parent here/getParentFolder"
			                     tal:content="parent/Title" ></div>
			<div class="textBlockMenu" >
 
			    <ul><tal:block define="parent here/getParentFolder"
			                   repeat="obj parent/objectValues">
			     <li tal:define="lastOne repeat/obj/end;
			                     selected python:(here.Title() == obj.Title())"
			         tal:condition="python:obj['portal_type']=='Folder' or obj['portal_type']=='Container' or obj['portal_type']=='ATFolder'"
			         tal:attributes="class python:here.getClassForRubrik(selected, lastOne)">
			         <a 
			            tal:content="obj/title"
			            tal:attributes="href obj/absolute_url"
			            class="linkRub"></a>
			     </li>
			     </tal:block>
			   </ul>  
			</div>
		</div>
	</div>
donc moi je penser que la produit n'aime pas trop cette expression
Code : Sélectionner tout - Visualiser dans une fenêtre à part
tal:condition="python:obj['portal_type']=='Folder' or obj['portal_type']=='Container' or obj['portal_type']=='ATFolder'"
et du coup, j'ai aimer savoir si on une autre expression qui fai le meme fonctionnement mais d'autre maniere (en ZPT si c possible)
merci d'avance