#66 — AttributeError: header after clicking the 'Browse...' button in an un-saved bibliography list

StateUnconfirmed
Version: 1.0
AreaFunctionality
Issue typeBug
SeverityMedium
Submitted byGraham Perrin
Submitted onFeb 06, 2008
Responsible
Target release:
Return to tracker
Last modified on Feb 17, 2009 by Mikko Ohtamaa
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Products.CMFPlone.FactoryTool, line 376, in __call__
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 216, in _exec
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   - Warning: Macro expansion failed
   - Warning: exceptions.AttributeError: header
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 870, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/Users/gjp22/Plone-3.0-buildout/zeocluster/parts/products-svn/ATBiblioList/skins/bibliography_list/popup_bibrefbrowser.pt
   - Line 21, Column 2
   - Expression: <PathExpr standard:u'here/header/macros/html_header'>
   - Names:
      {'container': <PloneSite at /Plone>,
       'context': <BibliographyList at /Plone/portal_factory/BibliographyList/bibliographylist.2008-02-06.3517515361 used for /Plone>,
       'default': <object object at 0x392528>,
       'here': <BibliographyList at /Plone/portal_factory/BibliographyList/bibliographylist.2008-02-06.3517515361 used for /Plone>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x94c8a30>,
       'request': <HTTPRequest, URL=http://localhost:5555/[…]/popup_bibrefbrowser>,
       'root': <Application at >,
       'template': <FSPageTemplate at /Plone/popup_bibrefbrowser used for /Plone/portal_factory/BibliographyList/bibliographylist.2008-02-06.3517515361>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 153, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 80, in boboAwareZopeTraverse
  Module OFS.Traversable, line 301, in restrictedTraverse
  Module OFS.Traversable, line 269, in unrestrictedTraverse
   - __traceback_info__: ([], 'header')
AttributeError: header

----

Plone 3.0.5
CMF-2.1.0
Zope (Zope 2.10.5-final, python 2.4.4, darwin)
Python 2.4.4 (#1, Feb 1 2008, 01:26:53) [GCC 4.0.1 (Apple Computer, Inc. build 5370)]
PIL 1.1.6

Installer version: Unified Installer Plus Buildout - beta 2

Installed products:

ATBiblioList svn/1.0 (build 0003)
ATBiblioStyles svn/1.0 (build 0001)
ATBiblioTopic svn/1.0 (build 0010)
ATExtensions svn/trunk (build 002)
AmazonTool svn/1.0 (build 0004)
CMFBibliographyAT svn/1.0 (build 0028)
SmartPrintNG 1.0.1
Local browser layer support

Also present, but not installed:

ARFilePreview 2.2.0-pre2
AROfficeTransforms 0.9.2
CMFPlacefulWorkflow 1.2.1
Calendaring 0.3.0
ContentLicensing 2.0.0
LinguaPlone 2.1 (svn/unreleased)
Marshall 1.0.0-dev
NuPlone 0.9.3
PloneFlashUpload 1.1 beta2
PloneHelpCenter 1.5 beta 6
PloneKeywordManager 1.5-alpha1
Ploneboard 2.0b2
PubmedClient SVN trunk; unreleased
RedirectionTool 1.2
RichDocument 3.0.1
SimpleAlias 2.0RC1
SimpleAttachment 3.0.1
Working Copy Support (Iterate) 1.0
OpenID Authentication Support 1.0-b1
Dropdown menus profile
Steps to reproduce:
 1. At a Plone site home

 2. Add new… Bibliography List

 3. enter a title

 4. click the 'Browse...' button
Added byMikko OhtamaaonFeb 17, 2009 03:18 PM
I am not sure whether saved or unsaved is related to this problem.

However, I managed to get the pop-up working by adding a custom <head> section to popup_bibrefbrowser.pt. Looks like header macro has been removed in some point, maybe due to introduction of viewlets. I copied the source from AtReferenceBrowseWidget popup template.

So, edit popup_bibrefbrowser.pt and drop in this:

<head tal:define="ztu modules/ZTUtils;">
    <title tal:content="here/title_or_id">Title or Id</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"
          tal:define="charset here/portal_properties/site_properties/default_charset;
                      dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;;charset=%s' % charset)"
          tal:attributes="content string:text/html;;charset=${charset}" />
    <tal:styles define="view context/@@plone|nothing"
                replace="structure provider:plone.resourceregistries.styles" />

    <script language="javascript" type="text/javascript">
         function showMessage(message) {
            element = document.getElementById('message');
            element.style.display='block';
            inner = document.getElementById('messageTitle');
            inner.innerHTML = message;
         }
         function submitHistoryForm() {
             var form = document.history;
             var path = form.path.options[form.path.selectedIndex].value;
             form.action = path;
             form.submit();
         }
    </script>

    <link rel="stylesheet" type="text/css" media="screen" href=""
          tal:attributes="href string:$portal_url/popupbrowser.css" />

</head>

No responses can be added.