[Zope-dev] This was fun!!!

Lennart Regebro lennart@torped.se
Tue, 15 Oct 2002 18:00:33 +0200


Here was a fun error I had. Try and figure out where the bug is!

I had this dtml-code:

<dtml-if getEasyLanguageService>
          <dtml-let ELS="getEasyLanguageService">
              <dtml-in getAllLanguages>
                <dtml-var "ELS.getLanguageByRFC3066(_['sequence-item'])"
html_quote>
              </dtml-in>
          </dtml-let>
</dtml-if>

This worked fine. I then changed it to this:

<dtml-if "is_language_aware() and getEasyLanguageService()">
          <dtml-let ELS="getEasyLanguageService">
              <dtml-in getAllLanguages>
                <dtml-var "ELS.getLanguageByRFC3066(_['sequence-item'])"
html_quote>
              </dtml-in>
          </dtml-let>
</dtml-if>

Now this fails, and it fails in:
   <dtml-var "ELS.getLanguageByRFC3066(_['sequence-item'])" html_quote>
with an "function attributes not accessible in restricted mode" error!

Now, where is the bug? :-)

First answers get 5 ZopeZen coolness credit points. An explanation to why
the first version works gets 100 points! :-)

Best Regards

Lennart Regebro, Torped
http://www.easypublisher.com/