Re: [Zope-dev] Catalog acquisition problems?
Martijn Faassen writes:
We've been experiencing some odd interactions between the ZCatalog and acquisition. Inside the <dtml-in catalog ..> tags things seem to go screwy. It's picking up the properties in the root folder instead of in the subfolder (the context), where the <dtml-in catalog ..> is used. Why would this happen? I could reproduce this in Zope 2.1.6.
I can understand that the result is not what one wants, but when I understand aquisition correct, it is in accordance with the documentation. You probably get "catalog" by aquisition. The catalogs aquisition context is inherited to the "Result" object and then to the "Record" objects representing the lookup results. As I understand, a feature request to such a record first follows the aquisition chain of catalog and only then the aquicition chain that led to catalog.
Another odd thing that happens is that dtml-let variables appeared wiped empty inside the dtml-in:
<dtml-let foo="'bar'"> <dtml-in catalog ..> .... <dtml-var foo> .... </dtml-in> </dtml-let>
The <dtml-var foo> will display nothing. 'foo' *does* exist, but it just appears to be empty. I could not reproduce this in my Zope installation.
Do your Record objects (results of "dtml-in") have a "foo" field (maybe inherited)? Dieter
Dieter Maurer wrote:
Martijn Faassen writes: [snip acquisition 'problem' with the catalog] I can understand that the result is not what one wants, but when I understand aquisition correct, it is in accordance with the documentation.
Yes, after some more pondering and some experimentation it makes sense. The confusion arose because of the use of 'dtml-in'; it makes sense more easily when you think of dtml-in as a repeated dtml-with. [snip]
Another odd thing that happens is that dtml-let variables appeared wiped empty inside the dtml-in: [snip] I could not reproduce this in my Zope installation.
We should've experimented some more here; it turned out to be a name aliasing problem -- our records were indeed acquiring the same name from somewhere else (a folder) which screwed things up. Thanks for your feedback! Martijn
participants (2)
-
Dieter Maurer -
Martijn Faassen