[Zope] DTML meth makes Zope 2.4.0 core dump...

Pierre-Julien Grizel grizel@mouli.net
Fri, 03 Aug 2001 18:56:04 +0200


Ok, here they are :

py_sample_script: (without ANY binding)
  return "OK"


dtml_mytest: (DTML Method)
 [...several dtml-in or dtml-with...]
      <dtml-var "html_results_list(
        RESULT, 
        meth_search_fields(), 
        py_sample_script)">
 [...]


meth_search_fields: (Py script)
  return [
    ('Title', 'Object Title'),
    ('Year', 'Object Year'),
  ]

html_results_list: (Py script, taking "results, fileds, converter" parameters)
  [...miscelaneous treatments without side effect for our purpose - I eventually
removed them to test...]
  return container.html_results_list_build(None, context, RESULTS=results,
FIELDS=fields, CONVERTER=converter)

html_results_list_build: (DTML Method)
<table>

  <tr>
  <dtml-in FIELDS>
    <th><dtml-var sequence-item></th>
  </dtml-in>
  </tr>

  <dtml-in RESULTS>
    <dtml-let RESULT=sequence-item>
      <tr>
        <dtml-in FIELDS>
          <td><dtml-var "CONVERTER('', '')"></td>
        </dtml-in>
      </tr>
    </dtml-let>
  </dtml-in>

</table>



What is funny as well is that if I remove the <dtml-let> statement in the last
method, it works. If I replace it with a <dtml-call REQUEST.set>, it DOESN'T
work. But the fact is I really need the RESULTS sequence-item within the second
loop...




Thanks for your help,


P.-J.


Chris McDonough wrote:
> 
> Pierre,
> 
> Please send the CONVERTER PythonScript and whatever FIELDS and RESULTS
> are.  This bug report is not reproducible without them.
> 
> Pierre-Julien Grizel wrote:
> >
> > (BTW I forget in my previous post to precise I use 2.4.0 on FreeBSD).
> >
> > Here is a DTML Method :
> >
> >   <dtml-in RESULTS>
> >     <dtml-let RESULT=sequence-item>
> >       <tr><dtml-var "CONVERTER('','')">
> >         <dtml-in FIELDS>
> >           <td><dtml-var "CONVERTER('', '')"></td>
> >         </dtml-in>
> >       </tr>
> >     </dtml-let>
> >   </dtml-in>
> >
> > This method is called from a Python Script, and CONVERTER is a reference to
> > another Python Script.
> >
> > The first <dtml-var "CONVERTER('','')"> works perfectly (the script is called
> > and returns correctly), but the SECOND ONE makes Zope core dump. Urglhh...
> >
> > Can someone explain me this more than strange (and more than annoying) behaviour
> > ?
> >
> > Thanks,
> >
> > Regards,
> >
> > P.-J.
> >
> > --
> > If the only tool you have is a hammer,
> >     you tend to see every problem as a nail.
> > Si le seul outil dont vous disposez est un marteau,
> >     vous avez tendance à voir chaque problème comme un clou.
> >                                        --Abraham Maslow