Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

#11421 closed defect (fixed)

Duplicate entries on System Info page

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: general Version: 1.0-stable
Severity: normal Keywords: about
Cc: Branch:
Release Notes:

Prevent duplicated entries in System Information to disable the trac.test package by default.

API Changes:

Environment.is_component_enabled returns None if passing a component in the trac.test package.

Internal Changes:

Description

I've noticed this several times in development and production Trac instances, but it doesn't occur on every instance.

Attachments (1)

SystemInformation.png (14.7 KB ) - added by Ryan J Ollos 11 years ago.

Download all attachments as: .zip

Change History (7)

by Ryan J Ollos, 11 years ago

Attachment: SystemInformation.png added

comment:1 by Ryan J Ollos, 11 years ago

Keywords: about added
Milestone: next-stable-1.0.x

comment:2 by Jun Omae, 11 years ago

trac.env.Environment and trac.test.EnvironmentStub which is a subclass of the former class generate the duplicated entries.

  • trac/env.py

    diff --git a/trac/env.py b/trac/env.py
    index f976ef8..59b5856 100644
    a b class Environment(Component, ComponentManager):  
    304304                break
    305305            cname = cname[:idx]
    306306
    307         # By default, all components in the trac package are enabled
    308         return component_name.startswith('trac.') or None
     307        # By default, all components in the trac package except trac.test
     308        # are enabled
     309        return component_name.startswith('trac.') and \
     310               not component_name.startswith('trac.test.') or None
    309311
    310312    def enable_component(self, cls):
    311313        """Enable a component or module."""
  • trac/test.py

    diff --git a/trac/test.py b/trac/test.py
    index cffc711..69cdd4e 100755
    a b class EnvironmentStub(Environment):  
    241241
    242242    href = abs_href = None
    243243    dbenv = db = None
     244    required = False
    244245
    245246    def __init__(self, default_data=False, enable=None):
    246247        """Construct a new Environment stub object.

comment:3 by Ryan J Ollos, 11 years ago

Milestone: next-stable-1.0.x0.12.6

Oh, nice find. Any idea why I only see this for some environments?

comment:4 by Jun Omae, 11 years ago

Well, the trac.test package normally is not loaded from Trac itself. But some plugins can load the package, e.g. th:source:tagsplugin/trunk/tractags/ticket.py@13461:16. When it is loaded, the issue would be reproduced.

Also, it is reproduced with 0.12-stable and 1.0.1. However it is not reproduced after r11758.

comment:5 by Jun Omae, 11 years ago

Owner: set to Jun Omae
Status: newassigned

Proposed changes with unit tests can be found in log:jomae.git:t11421. I'll push to 0.12-stable branch later.

Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:6 by Jun Omae, 11 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed into 0.12-stable in [12442] and merged in [12443,12444].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.