Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11855 closed defect (fixed)

Textarea custom field property cols has been removed in Trac 1.1.2dev

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: CustomFieldAdminPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

How to Reproduce

While doing a GET operation on /admin/ticket/customfields, Trac issued an internal error.

In trac:#11471 we removed the cols property of textarea custom fields. See [trac 12512].

The following patch should be sufficient:

  • customfieldadminplugin/0.11/customfieldadmin/api.py

    diff --git a/customfieldadminplugin/0.11/customfieldadmin/api.py b/customfieldad
    index 7466c69..faebb98 100644
    a b class CustomFields(Component): 
    7676        items = TicketSystem(self.env).get_custom_fields()
    7777        for item in items:
    7878            if item['type'] == 'textarea':
    79                 item['cols'] = item.pop('width')
     79                if 'width' in item:
     80                    item['cols'] = item.pop('width')
    8081                item['rows'] = item.pop('height')
    8182            if cfield and item['name'] == cfield['name']:
    8283                return item  # only return specific item with cfname

Request parameters:

{'cat_id': u'ticket', 'panel_id': u'customfields', 'path_info': None}

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0

System Information

Trac 1.1.2dev-r0
Babel 0.9.6
Docutils 0.12
Genshi 0.7 (with speedups)
GIT 1.8.1.2
Mercurial 2.2.2
Pygments 1.6dev-20140608
pysqlite 2.6.3
Python 2.7.4 (default, Sep 26 2013, 03:20:26)
[GCC 4.7.3]
pytz 2014.4
setuptools 0.6
SQLite 3.7.15.2
Subversion 1.8.9 (r1591380)
jQuery 1.8.3
jQuery UI 1.9.2
jQuery Timepicker 1.1.1

Enabled Plugins

TracCustomFieldAdmin 0.2.8
TracMercurial 1.0.0.3dev
Tracticketstats 3.0.0dev

Python Traceback

Traceback (most recent call last):
  File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/web/main.py", line 530, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/web/main.py", line 223, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/admin/web_ui.py", line 124, in process_request
    path_info)
  File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/ticket/admin.py", line 329, in render_admin_panel
    for item in cf_api.get_custom_fields():
  File "/home/user/Workspace/tracdev/teo-rjollos.git/trac/ticket/api.py", line 213, in get_custom_fields
    item['cols'] = item.pop('width')
KeyError: 'width'

Attachments (0)

Change History (2)

comment:1 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 14260:

0.2.10: Support Trac 1.1.2 in which the cols property of Custom Field textareas has been removed. Fixes #11855.

comment:2 Changed 10 years ago by Ryan J Ollos

Owner: changed from osimons to Ryan J Ollos

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.