Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14059 closed defect (duplicate)

UndefinedError: 'item' is undefined

Reported by: anonymous Owned by:
Priority: normal Component: CrystalxTheme
Severity: normal Keywords:
Cc: Trac Release: 1.4

Description

Just after crystalxtheme.* = enabled

Traceback (most recent call last):
  File "venvp27/lib/python2.7/site-packages/trac/web/main.py", line 684, in _send_error
    data, metadata)
  File "venvp27/lib/python2.7/site-packages/trac/web/chrome.py", line 1443, in render_template
    fragment, iterable, method)
  File "venvp27/lib/python2.7/site-packages/trac/web/chrome.py", line 1535, in _render_jinja_template
    iterable)
  File "venvp27/lib/python2.7/site-packages/trac/web/chrome.py", line 1656, in generate_template_stream
    return b''.join(generate())
  File "venvp27/lib/python2.7/site-packages/trac/web/chrome.py", line 1654, in generate
    for chunk in stream:
  File "venvp27/lib/python2.7/site-packages/jinja2/environment.py", line 1357, in __next__
    return self._next()
  File "venvp27/lib/python2.7/site-packages/jinja2/environment.py", line 1334, in _buffered_generator
    c = next(self._gen)
  File "venvp27/lib/python2.7/site-packages/jinja2/environment.py", line 1125, in generate
    yield self.environment.handle_exception()
  File "venvp27/lib/python2.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "venvp27/lib/python2.7/site-packages/trac/templates/error.html", line 95, in top-level template code
    <input type="submit" name="create" value="${_('Create')}" />
  File "venvp27/lib/python2.7/site-packages/trac/templates/layout.html", line 12, in top-level template code
    # import "macros.html" as jmacros with context
  File "venvp27/lib/python2.7/site-packages/crystalxtheme/templates/crystalx_theme.html", line 13, in top-level template code
    class="${classes(first_last(idx, chrome.nav[category]), active=item.active)}">${item.label}</li>
  File "venvp27/lib/python2.7/site-packages/jinja2/environment.py", line 471, in getattr
    return getattr(obj, attribute)
UndefinedError: 'item' is undefined

https://trac-hacks.org/ticket/14058#ticket

Attachments (0)

Change History (9)

comment:1 Changed 3 years ago by figaro

Priority: highestnormal
Severity: criticalnormal

Duplicate of #13761?

comment:2 Changed 3 years ago by Jun Omae

Resolution: duplicate
Status: newclosed

Exactly.

comment:3 Changed 3 years ago by anonymous

Can be explained situation?

\lib\python2.7\site-packages\trac\templates\genshi\index.html - this is genshi

\lib\python2.7\site-packages\trac\templates\index.html - this is Jinja2 solution ?

comment:4 Changed 3 years ago by Ryan J Ollos

It's not compatible with Trac 1.4 (Jinja). Someone needs to port the templates. See comment:2:ticket:13761.

comment:5 Changed 3 years ago by anonymous

I see.. I'm looking some simple solution to have template like main trac.edgewall.org (as table in center with gray frame borders, and set sizes for this center). The https://trac-hacks.org/wiki/BasicThemeEditorPlugin not working for me.

Version 0, edited 3 years ago by anonymous (next)

comment:6 Changed 3 years ago by anonymous

Most of plugins have this type problem:

Collecting https://trac-hacks.org/browser/basicthemeeditorplugin?rev=18451
  Downloading https://trac-hacks.org/browser/basicthemeeditorplugin?rev=18451
     / 14 kB 248 kB/s
  ERROR: Cannot unpack file /tmp/pip-unpack-ESFr17/basicthemeeditorplugin (downloaded from /tmp/pip-req-build-nvoY1m, content-type: text/html;charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /tmp/pip-req-build-nvoY1m

In case I do install in manual. Sorry for off top here.

comment:7 Changed 3 years ago by Ryan J Ollos

See TracPlugins#Fromsource.

$ pip install svn+https://trac-hacks.org/svn/basicthemeeditorplugin/trunk

Note that BasicThemeEditorPlugin may not be compatible with Trac 1.4. Check the tags on the wiki page. BasicThemeEditorPlugin is labeled with only the 0.11 tag. It might work with 1.4, but likely not.

comment:8 in reply to:  5 Changed 3 years ago by Ryan J Ollos

Replying to anonymous:

I see.. I'm looking some simple solution to have template like main trac.edgewall.org (as table in center with gray frame borders, and set sizes for this center). The BasicThemeEditorPlugin not working for me.

Please ask on the trac:MailingList and someone can help with theme'ing your Trac install.

comment:9 Changed 3 years ago by anonymous

In case it was instaled not working like in comment in your post. In my opinion to much plugins not working with Trac 1.4 as stable.. right? Then trac is limited to manage and configure to typical needs to usage.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.