#12474 closed defect (cantfix)
Trac Custom fields are not displaying the Wiki formatting
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | high | Milestone: | |
Component: | wiki system | Version: | 1.0.9 |
Severity: | normal | Keywords: | wiki |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
I've created several custom fields in the [ticket-custom]
section of our configuration file. E.g.
evaluation.cols = 80 evaluation.format = wiki evaluation.label = Evaluation evaluation.order = 320 evaluation.rows = 20 evaluation = textarea
This should specify that when the field is populated with wiki formatting it changes the format to bold etc. However this does not occur. The field is displaying '''test'''
.
Whats stranger is when I do the same in the description field, i get the correct formatting, or if i load up tracwysiwyg, it accepts the formatting is correct.
We are currently using Trac 1.0.9 and traccustomfieldplugin 0.2.8. Can someone help direct us to how to force the wiki formatting to be accepted.
Attachments (7)
Change History (24)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
This plugin is currently disabled. We have version 0.12.0.5 installed, but not active.
However this has still not fixed the problem.
Mike
comment:4 by , 8 years ago
Hi,
Have you been able to progress this? I'm going to install a fresh version to test it out tomorrow, and would appreciate some input before going through the process.
Mike
comment:5 by , 8 years ago
Milestone: | 1.0.11 |
---|
I cannot reproduce and I don't see what the issue could be with the software. I suspect it is an InstallationIssue.
comment:6 by , 8 years ago
I guess that !'''test!'''
is stored in the field. Please check the record in ticket_custom
table like this:
-- replace 42 with your ticket's id SELECT * FROM ticket_custom WHERE ticket=42 AND name='evaluation';
by , 8 years ago
comment:7 by , 8 years ago
I've attached a file with the output. It looks as though its just outputting
'''test'''
by , 8 years ago
Attachment: | 20160506T173141.png added |
---|
comment:9 by , 8 years ago
It works for me with Trac 1.0.10.
db/trac.db:
$ sqlite3 /dev/shm/tracenv/db/trac.db SQLite version 3.8.2 2013-12-06 14:53:30 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> SELECT * FROM ticket; 1|defect|1462523363585196|1462523363585196|component1||major|somebody|admin||||new||test|| sqlite> SELECT * FROM ticket_custom; 1|evaluation|#10 '''test'''
conf/trac.ini:
# -*- coding: utf-8 -*- [project] name = Project [ticket-workflow] accept = new,assigned,accepted,reopened -> accepted accept.operations = set_owner_to_self accept.permissions = TICKET_MODIFY leave = * -> * leave.default = 1 leave.operations = leave_status reassign = new,assigned,accepted,reopened -> assigned reassign.operations = set_owner reassign.permissions = TICKET_MODIFY reopen = closed -> reopened reopen.operations = del_resolution reopen.permissions = TICKET_CREATE resolve = new,assigned,accepted,reopened -> closed resolve.operations = set_resolution resolve.permissions = TICKET_MODIFY [trac] database = sqlite:db/trac.db [ticket-custom] evaluation.cols = 80 evaluation.format = wiki evaluation.label = Evaluation evaluation.order = 320 evaluation.rows = 20 evaluation = textarea
comment:10 by , 8 years ago
Hi,
I've been trying some debugging myself. We have been using Trac 1.0.1 successfully with this config file, and it has had no issues. I've been testing a little with tracd this morning, and have got some interesting results.
On Trac 1.0.9, it does not work, and on Trac 1.0.10, the wiki text does not work. See attached image.
However, the same config file is working successfully on 1.0.1 when i install it (see attached image).
Mike
by , 8 years ago
Attachment: | trac1.0.1.png added |
---|
by , 8 years ago
Attachment: | trac1.0.9.png added |
---|
by , 8 years ago
Attachment: | trac1.0.10.png added |
---|
by , 8 years ago
comment:11 by , 8 years ago
Thanks for the investigating!
Would you please try to disable all components? I guess hiddenfields
and/or templatedfields
plugins lead the issue….
comment:12 by , 8 years ago
I've tried removing all the plugins, and changing the config file, and running basic trac, but still no change. I've attached a picture showing the new state.
by , 8 years ago
Attachment: | trac1.0.9_no_2.png added |
---|
follow-up: 14 comment:13 by , 8 years ago
If customized templates are put into $ENV/templates
directory, please try to remove the templates. We've changed ticket_box.html
after Trac 1.0.1.
See log:/branches/1.0-stable/trac/ticket/templates/ticket_box.html and [13389].
comment:14 by , 8 years ago
Replying to Jun Omae:
If customized templates are put into
$ENV/templates
directory, please try to remove the templates. We've changedticket_box.html
after Trac 1.0.1.
Good thought.
With that in mind, maybe this is a case of not having executed the Probably unrelated to deploy
command after upgrade: TracUpgrade#a5.Refreshstaticresources.deploy
command since it only affects static resources, not templates.
comment:15 by , 8 years ago
This has solved the problem.
I've looked at our template, and modified it to include:
<py:if test="field"> <py:choose test=""> <py:when test="'rendered' in field">${field.rendered}</py:when> <py:otherwise> ${wiki_to_html(context, ticket[field.name], escape_newlines=preserve_newlines)} </py:otherwise> </py:choose> </py:if>
However, I would ideally like to do a test for field.format = wiki. Do you know what the code should be to achieve this? I cannot seem to get this or anything similar to generate data.
comment:16 by , 8 years ago
Resolution: | → cantfix |
---|---|
Status: | new → closed |
If you had to modify the templates to add that section, then your Trac installation is not utilizing the Trac templates from Trac 1.0.9. You have an InstallationIssue, and should remove and reinstall Trac. If you let us know your platform, python version and how you installed Trac, we can give some hints on how to uninstall Trac.
You could also try installing to a virtual environment if you have python-virtualenv
package installed. If you are running Python 2.7.9 or later, or install python-pip
:
$ virtualenv pve $ . pve/bin/activate $ pip install trac
Installing into a virtualenv will give you a clean site-packages directory that will be unaffected by previous Trac installations, as long as you are using virtualenv 1.7 or later and don't specify the --system-site-packages
flag.
comment:17 by , 8 years ago
I may have misunderstood. If you have a custom ticket_box.html
, the best solution would be to implement your customizations in a plugin that implements IRequestFilter
. The second best solution would be to diff your ticket_box.html
against the version of the template that you copied, and apply the changes to the latest ticket_box.html
from 1.0.9 (or even better, install the latest, Trac 1.0.11).
The test for format = wiki
can be seen in ticket_box.html
: tags/trac-1.0.9/trac/ticket/templates/ticket_box.html@:96#L86.
It works for me with Trac 1.0.9. This is most likely an InstallationIssue. Please try with TracWysiwygPlugin disabled.