Modify

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#13574 closed defect (worksforme)

hide_always = true field still appearing

Reported by: Adrian Heath Owned by: Ryan J Ollos
Priority: normal Component: DynamicFieldsPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description (last modified by Ryan J Ollos)

Trac 1.2, dynamicfield source zip r17416

  1. hide_always = true fields still appear when modifying ticket (example is cc)
  2. hide_always = (pref:disable) still appear even when user-pref says to hide (example is purchaseorder)
[components]
customfieldadmin.admin.customfieldadminpage = enabled
customfieldadmin.api.customfields = enabled
datefield.* = enabled
datefield.filter.customfieldadmintweak = disabled
datefield.filter.datefieldmodule = disabled
dynfields.rules.clearrule = enabled
dynfields.rules.copyrule = enabled
dynfields.rules.defaultrule = enabled
dynfields.rules.hiderule = enabled
dynfields.rules.setrule = enabled
dynfields.rules.validaterule = enabled
dynfields.web_ui.dynamicfieldsmodule = enabled
ganttcalendar.ticketcalendar.ticketcalendarplugin = enabled
ganttcalendar.ticketgantt.ticketganttchartplugin = enabled
gridmod.* = enabled
importexportxls.admin_ui.importexportadminpanel = disabled
nevernotifyupdaterplugin.* = enabled
nevernotifyupdaterplugin.api.nevernotifyupdatersetupparticipant = enabled
privatereports.privatereports.privatereports = disabled
privatetickets.* = enabled
talm_importer.importer.* = enabled
tickettemplate.* = enabled
timingandestimationplugin.* = enabled
timingandestimationplugin.ticket_policy.internalticketspolicy = enabled
trac.versioncontrol.admin.repositoryadminpanel = disabled
trac.versioncontrol.admin.versioncontroladmin = disabled
trac.versioncontrol.api.dbrepositoryprovider = disabled
trac.versioncontrol.api.repositorymanager = disabled
trac.versioncontrol.svn_authz.authzsourcepolicy = disabled
trac.versioncontrol.web_ui.browser.browsermodule = disabled
trac.versioncontrol.web_ui.browser.defaultpropertyrenderer = disabled
trac.versioncontrol.web_ui.browser.wikipropertyrenderer = disabled
trac.versioncontrol.web_ui.changeset.anydiffmodule = disabled
trac.versioncontrol.web_ui.changeset.changesetmodule = disabled
trac.versioncontrol.web_ui.changeset.defaultpropertydiffrenderer = disabled
trac.versioncontrol.web_ui.log.logmodule = disabled
tracopt.perm.config_perm_provider.extrapermissionsprovider = enabled
tracopt.ticket.deleter.ticketdeleter = enabled
tracopt.versioncontrol.svn.svn_fs.subversionconnector = disabled
tracopt.versioncontrol.svn.svn_prop.subversionmergepropertydiffrenderer = disabled
tracopt.versioncontrol.svn.svn_prop.subversionmergepropertyrenderer = disabled
tracopt.versioncontrol.svn.svn_prop.subversionpropertyrenderer = disabled
tracrpc.* = enabled
tracwysiwyg.templateprovider = enabled
tracwysiwyg.wysiwygwikifilter = enabled
viz.* = enabled
worklog.* = enabled


[ticket-custom]
billable = checkbox
billable.clear_on_hide = false
billable.hide_always = (pref:disable)
billable.label = Billable Work
billable.order = 6
billable.value = 1
bugcat = select
bugcat.clear_on_hide = false
bugcat.invalid_if = pick one
bugcat.label = Bug Type
bugcat.options = Calculation / filter error|Communication error|Control flow error|Error handling|Functionality Error|Missing command error|Supplier issue|Visual / refresh error|
bugcat.order = 0
bugcat.show_when_type = defect
cc.hide_always = true
cc.clear_on_hide = false
purchaseorder = text
purchaseorder.clear_on_hide = false
purchaseorder.hide_always = (pref:disable)
purchaseorder.label = Purchase Order

Displaying ticket generates following error in (firefox 68.0) browser

jQuery.Deferred exception: input.attr(...) is undefined inputs_layout.get_field@http://trac.tracktrans.net/projects/tt/chrome/dynfields/layout.js:112:16
Layout/this.update/<@http://trac.tracktrans.net/projects/tt/chrome/dynfields/layout.js:38:27
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:3755
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:1837
Layout/this.update@http://trac.tracktrans.net/projects/tt/chrome/dynfields/layout.js:37:29
hiderule.complete@http://trac.tracktrans.net/projects/tt/chrome/dynfields/rules.js:224:17
window.apply_rules/</<@http://trac.tracktrans.net/projects/tt/chrome/dynfields/dynfields.js:36:19
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:3755
window.apply_rules/<@http://trac.tracktrans.net/projects/tt/chrome/dynfields/dynfields.js:35:9
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:3825
window.apply_rules@http://trac.tracktrans.net/projects/tt/chrome/dynfields/dynfields.js:34:7
dispatch@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:3:3039
add/elemData.handle@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:2:31701
trigger@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:4:14590
trigger/<@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:4:15557
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:3755
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:1837
trigger@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:4:15528
jQuery.fn[name]@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:5:8063
@http://trac.tracktrans.net/projects/tt/chrome/dynfields/dynfields.js:74:35
each@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:1:3755
@http://trac.tracktrans.net/projects/tt/chrome/dynfields/dynfields.js:73:7
mightThrow@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:2:15044
resolve/</process<@http://trac.tracktrans.net/projects/tt/chrome/common/js/jquery.js:2:15698
 undefined jquery.js:2:17830
TypeError: input.attr(...) is undefined layout.js:112:16

Clicking modify opens ticket for editing but both CC and purchaseorder fields are visible even though flagged as always hidden

System information

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Package	Version
Trac 	1.2.3
Babel 	2.6.0
Docutils 	0.14
Genshi 	0.7.1 (with speedups)
mod_python 	3.3.1
Pygments 	2.3.1
pysqlite 	2.6.0
Python 	2.7.16 (default, Apr 6 2019, 01:42:57) [GCC 8.3.0]
pytz 	2019.1
RPC 	1.1.7.dev0
setuptools 	40.8.0
SQLite 	3.27.2
jQuery	3.3.1
jQuery UI	1.12.1
jQuery Timepicker	1.2

Attachments (5)

Screenshot_20190722_094032.png (111.1 KB) - added by Adrian Heath 7 months ago.
Screen shot of adding new ticket
Screenshot_20190722_095749.png (117.6 KB) - added by Adrian Heath 7 months ago.
browser console of new ticket
newticket.pdf (189.2 KB) - added by Adrian Heath 7 months ago.
html source of new ticket
28363_ticket.pdf (269.8 KB) - added by Adrian Heath 7 months ago.
Ticket view after save
Screenshot_20190722_101634.png (108.0 KB) - added by Adrian Heath 7 months ago.
after save

Download all attachments as: .zip

Change History (16)

comment:1 Changed 7 months ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 7 months ago by Ryan J Ollos

Description: modified (diff)

Trac 1.2.x uses jQuery 1.11.3. You are using jQuery 3.3.1. Did you configure the jQuery location, or did you install Trac via an OS package manager, such as Debian?

You can point jQuery to a CDN to use version 1.11.3: TracIni#trac-jquery_location-option. I suggest doing that, because Trac isn't tested with any other version of jQuery.

comment:3 Changed 7 months ago by anonymous

Yes, installed Trac 1.2.3 using Debian apt package manager over top of existing 0.12 release

Sequence was

  1. OS upgraded using apt from Debian 6 (Squeeze)-> Debian 7 (Wheezy) -> Debian 8 (Jessie)-> Debian 9 (Stretch) -> Debian 10 (Buster)
  2. Apt used to upgrade Trac from 0.12 to 1.2.3

Have now added following entries in trac.ini / [Trac]

jquery_location = https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
jquery_ui_location = https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js

Restarted server (OS reboot) Closed browsers (both firefox v68 & chrome) Restarted browsers and

Trac About shows above versions of jquery/jquery-ui

System information

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Package	Version
Trac 	1.2.3
Docutils 	0.14
Genshi 	0.7.1 (with speedups)
mod_python 	3.3.1
Pygments 	2.3.1
pysqlite 	2.6.0
Python 	2.7.16 (default, Apr 6 2019, 01:42:57) [GCC 8.3.0]
pytz 	2019.1
RPC 	1.1.7.dev0
setuptools 	40.8.0
SQLite 	3.27.2
jQuery	1.11.3
jQuery UI	1.11.4
jQuery Timepicker	1.2

No difference in either firefox or chrome

always_hidden and hidden pref still visable

we have not started to extend plugin usage to include hide/show if selected functionality so dcant say whether that is working.

trac.ini includes

[trac-custom]
..
cc.clear_on_hide = false
cc.hide_always = true
..

but CC (Carbon copy email) part of utl/ticket/123#modify includes

<tr><th class="col1">
                      <label for="field-version">Version:</label>
                    </th><td class="col1">
                        <select id="field-version" name="field_version">
                          <option></option>
                          <option value="Dev TMS">Dev TMS</option><option value="RC TMS">RC TMS</option>
                        </select>
                    </td><th class="col2">
                      <label for="field-keywords">Keywords:</label>
                    </th><td class="col2">
                            <input type="text" id="field-keywords" name="field_keywords" value="">
                    </td></tr>

comment:4 Changed 7 months ago by Adrian Heath

Sorry, please ignore the above; I pasted the wrong inspect element from the browser for the CC / Bug Type row.

This is the correct element

<tr><th class="col1">
                      <label for="field-cc">Cc:</label>
                    </th><td class="col1">
                            <span>
                                  <input type="text" id="field-cc" title="Space or comma delimited email addresses and usernames are accepted." name="field_cc" value="">
                            </span>
                    </td><th class="col2">
                      <label for="field-bugcat">Bug Type:</label>
                    </th><td class="col2">
                        <select id="field-bugcat" name="field_bugcat">
                          <option></option>
                          <option value="Calculation / filter error">Calculation / filter error</option><option value="Communication error">Communication error</option><option value="Control flow error">Control flow error</option><option value="Error handling">Error handling</option><option value="Functionality Error">Functionality Error</option><option value="Missing command error">Missing command error</option><option value="Supplier issue">Supplier issue</option><option value="Visual / refresh error">Visual / refresh error</option>
                        </select>
                    </td></tr>

comment:5 Changed 7 months ago by Ryan J Ollos

Please check the browser console to see if there are any errors: TracTroubleshooting#ChecktheBrowserConsole.

Is the CC field still visible in both the Ticket properties (yellow box) and the Modify ticket section?

comment:6 in reply to:  3 Changed 7 months ago by Ryan J Ollos

Status: newaccepted

Replying to anonymous:

trac.ini includes

[trac-custom]
..
cc.clear_on_hide = false
cc.hide_always = true
..

I tested this configuration with Trac 1.2-stable and it works for me. So I think most likely this is due to a plugin conflict.

In addition to checking the console for JavaScript errors, please check the HTML source to be sure the plugin is loading:

<script type="text/javascript" charset="utf-8" src="/proj-1.2/chrome/dynfields/dynfields.js"></script>
<script type="text/javascript" charset="utf-8" src="/proj-1.2/chrome/dynfields/rules.js"></script>
<script type="text/javascript" charset="utf-8" src="/proj-1.2/chrome/dynfields/layout.js"></script>

Changed 7 months ago by Adrian Heath

Screen shot of adding new ticket

Changed 7 months ago by Adrian Heath

browser console of new ticket

Changed 7 months ago by Adrian Heath

Attachment: newticket.pdf added

html source of new ticket

Changed 7 months ago by Adrian Heath

Attachment: 28363_ticket.pdf added

Ticket view after save

Changed 7 months ago by Adrian Heath

after save

comment:7 Changed 7 months ago by Adrian Heath

Added screen shots of ticket page and html source which show that the dynfields, rules and layout javascript files were all being referenced

comment:8 in reply to:  5 Changed 7 months ago by Ryan J Ollos

Replying to Ryan J Ollos:

I tested this configuration with Trac 1.2-stable and it works for me. So I think most likely this is due to a plugin conflict.

I see now that you had already posted the browser console log in comment:description.

The quickest way to track this down would be to disable all of your plugins except DynamicFieldsPlugin and check if the error still occurs. Assuming it does not, re-enable the plugins one at a time until the error is encountered. Make sure to do a hard refresh of your browser after disabling/enabling a plugin.

comment:9 Changed 7 months ago by Adrian Heath

Worked - disabled timingandestimationplugin (v1.6.0b0), refreshed screen and /ticket/ hidden fields were then hidden.

Yea!

Eventually found that one of the timingandestimationplugin.tande_filters.* was what was breaking the dynamicfields plugin

TicketFormatFilter — Filtering the streams to alter the base format of the ticket

Will raise a ticket with that plugin's Author (also on track-hacks) to see if they can offer a solution

Thank you for your timely assistance

comment:10 Changed 7 months ago by Adrian Heath

Resolution: worksforme
Status: acceptedclosed

comment:11 Changed 7 months ago by Ryan J Ollos

Okay. I think there may be more to this than simply an error with TimingAndEstimationPlugin. We can continue discussing in #13576.

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.