Modify

Opened 13 years ago

Closed 5 years ago

Last modified 4 years ago

#8971 closed defect (fixed)

Enabling the hide rule wide textarea fields are not automatically put on their own lines

Reported by: sue.sml2006@… Owned by:
Priority: normal Component: DynamicFieldsPlugin
Severity: normal Keywords:
Cc: Jan Beilicke Trac Release: 0.12

Description

Using Trac 0.12.2, dynamic fields 1.2.1 I have a 60 column wide textarea field that ends up in the right hand column either in the yellow "view ticket" area or in "modify ticket" area (but never both at the same time) when I have the hide rule enabled. Doesn't seem to matter if i'm using the hide_always rule or not, just enabling the rule causes this strangeness. Attaching two screenshots, only difference is enabling the hide component.

Attachments (6)

trac_hide_disabled.png (158.4 KB) - added by sue.sml2006@… 13 years ago.
modify area when hide is disabled (i.e. how it should look)
trac_hide_disabled.2.png (158.4 KB) - added by sue.sml2006@… 13 years ago.
modify area when hide is disabled (i.e. how it should look)
trac_hide_enabled.png (151.3 KB) - added by sue.sml2006@… 13 years ago.
when hide is enabled, the "investigation_notes" field ends up in the right hand column
disable.patch (491 bytes) - added by Ruth Trevor-Allen 13 years ago.
Workaround
enableHideRule.png (87.8 KB) - added by sue.sml2006@… 13 years ago.
2020-10-13T19:59:21+02:00.png (44.9 KB) - added by mathieu@… 4 years ago.

Download all attachments as: .zip

Change History (35)

Changed 13 years ago by sue.sml2006@…

Attachment: trac_hide_disabled.png added

modify area when hide is disabled (i.e. how it should look)

Changed 13 years ago by sue.sml2006@…

Attachment: trac_hide_disabled.2.png added

modify area when hide is disabled (i.e. how it should look)

Changed 13 years ago by sue.sml2006@…

Attachment: trac_hide_enabled.png added

when hide is enabled, the "investigation_notes" field ends up in the right hand column

comment:1 Changed 13 years ago by sue.sml2006@…

I've been able to hide fields using the blackmagictweaks plugin, but your hide_always option works much better for hiding from query pages, so I would prefer to get this working if possible.

comment:2 Changed 13 years ago by Jan Beilicke

Cc: Jan Beilicke added; anonymous removed

Changed 13 years ago by Ruth Trevor-Allen

Attachment: disable.patch added

Workaround

comment:3 Changed 13 years ago by Ruth Trevor-Allen

I had this problem too. I found that disabling the bit of code that re-calculates layout when fields are hidden made it go away. Although not a perfect solution, this is a reasonable workaround. Simply delete or comment out the following lines from htdocs/layout.js:

        // get new field order
        var new_fields = jQuery.merge(visible, hidden); // warning: side-effects!            

        // order the fields
        this.order_fields(new_fields);  

Diff attached.

comment:4 Changed 13 years ago by Rob Guttman

Sue et al, I see. As @fleeblewidget figure out, I dynamically change the layout to fill gaps left by hidden fields. I've never used textarea custom fields before - I didn't even know they were available! - and so missed this when designing the layout algorithm.

It seems textarea fields need to enjoy their own row and not be crammed into one column or the other. I'll see if I can change the layout algorithm to accommodate.

comment:5 Changed 13 years ago by Rob Guttman

(In [11002]) refs #8971: now handles layout of textarea custom fields.

comment:6 Changed 13 years ago by Rob Guttman

Resolution: fixed
Status: newclosed

Sue / fleeblewidget - I think I may have solved this one. Please give it a try and let me know. Reopen this ticket if it's not quite right for you.

comment:7 Changed 13 years ago by sue.sml2006@…

Hi Rob, I finally got around to trying this and I dont see any change, I'm not sure I've included your code correctly. The fields still end up in the wrong spot as soon as i enable the hiderul. I am using a shared plugins folder, and I downloaded the latest plugin into my main projects plugins directory and ran setup.py install again, is it possible it's using some cached version of the plugin? how can I ensure it's using the latest? Thanks, sue

Changed 13 years ago by sue.sml2006@…

Attachment: enableHideRule.png added

comment:8 Changed 13 years ago by sue.sml2006@…

Hi Rob, I was able to use fleeblewidget's workaround. For whatever reason, any update you implemented did not fix the problem (I did figure out how to ensure my plugin was not cached)

comment:9 in reply to:  8 Changed 11 years ago by anonymous

Resolution: fixed
Status: closedreopened

Replying to sue.sml2006@…:

Hi Rob, I was able to use fleeblewidget's workaround. For whatever reason, any update you implemented did not fix the problem (I did figure out how to ensure my plugin was not cached)

Same problem. Will reopen.

comment:10 Changed 11 years ago by Ryan J Ollos

In 13650:

Bump version to 1.2.4. Refs #11378, #11118, #11523, #10126, #9605, #9986, #9996, #8971.

comment:11 Changed 10 years ago by anonymous

I am using version 2.2.0 of the plugin, with Trac 1.0.1, and I think I am experiencing the same thing. My situation looks like the attached screen shots.

More detail:

  • If I have a textarea custom field that has EXACTLY an even number of fields that are displayed prior to it (laid out above it) in the edit area of the ticket, then things behave. If I have an ODD number of fields above, then the textarea doesn't jump to a new row; I tried several variations and even saw it become the third column (<TD>) in the HTML row at one point. If I turn off the plugin, this behavior doesn't happen, this textarea that is 60 characters wide always gets to start a new row.
  • Even if I have an exact even number of fields laid out above this textarea, any time that the plugin causes any field to be hidden (using the hide rule), then the textarea misbehaves in the same way. In other words, if any field is hidden, I see the layout error, whether having an even or odd count of prior fields shown in the edit area.

comment:12 Changed 10 years ago by Ryan J Ollos

Cc: Ryan J Ollos added

comment:13 Changed 6 years ago by Ryan J Ollos

Owner: Rob Guttman deleted
Status: reopenednew

comment:14 Changed 5 years ago by Ryan J Ollos

Cc: Ryan J Ollos removed

comment:15 Changed 5 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

Textareas are put on their own line now. Tested with 1.4-stable and r17720.

Changed 4 years ago by mathieu@…

comment:16 Changed 4 years ago by anonymous

For information, it looks like I still get the same problem with TracDynamicFields-2.6.0.dev0 (r17865) and Trac 1.0.2 as seen in the attached image.

comment:17 in reply to:  16 ; Changed 4 years ago by Ryan J Ollos

Replying to anonymous:

For information, it looks like I still get the same problem with TracDynamicFields-2.6.0.dev0 (r17865) and Trac 1.0.2 as seen in the attached image.

Did you recently upgrade TracDynamicFields? It looks like you may need to redeploy or refresh static resources: TracUpgrade#a5.Refreshstaticresources.

Please upgrade to Trac 1.0.20. I'm not able to support such old versions of Trac.

comment:18 in reply to:  17 ; Changed 4 years ago by mathieu@…

Replying to Ryan J Ollos:

Please upgrade to Trac 1.0.20. I'm not able to support such old versions of Trac.

Yes of course you're right. I'll keep you postponed if something is still wrong after update by the instance owner. Thank you very much for your time.

comment:19 in reply to:  18 Changed 4 years ago by Ryan J Ollos

Replying to mathieu@…:

Yes of course you're right. I'll keep you postponed if something is still wrong after update by the instance owner. Thank you very much for your time.

Happy to help and I'll keep an eye out for a follow-up.

comment:20 Changed 4 years ago by mathieu@…

I just tried with trac 1.0.20 and I have the same problem. Do you have any insight to what I shall look for in order to troublehot the problem ?

comment:21 Changed 4 years ago by Ryan J Ollos

Did you try refreshing your browser cache and refreshing static resources?

comment:22 in reply to:  21 Changed 4 years ago by mathieu@…

Replying to Ryan J Ollos:

Did you try refreshing your browser cache and refreshing static resources?

Yes I refreshed my browser cache (Ctrl+R and event disable caching in webdev console) and If I understand well I don't think that refreshing static resources applies as the trac is served by a standalone tracd command.

comment:23 Changed 4 years ago by Ryan J Ollos

If you post your [ticket-custom] section I can do some testing. I'm probably going to drop support for Trac < 1.2 soon.

comment:24 Changed 4 years ago by Ryan J Ollos

You may want to try upgrading to at least Trac 1.2.

comment:25 Changed 4 years ago by mathieu@…

Sorry for the delay, I was offline for a week. Here is the ticket-custom session.

[ticket-custom]
analyse = textarea
analyse.cols = 83
analyse.format = wiki
analyse.label = Analyse
analyse.order = 95
analyse.value = Mettez ici la justification si cette règle n'a pas été modélisée
analyse.show_when_type = task
chrono = text
chrono.format = plain
chrono.label = Chrono
chrono.show_when_type = delivery
chrono.clear_on_hide = false
complete = select
complete.order = 10
complete.label = Completed [%]
complete.options = 0|5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80|85|90|95|100
complete.order = 10
complete.show_when_type = task
date_prevue = text
date_prevue.date = true
date_prevue.date_empty = true
date_prevue.label = Date prévue (Y-m-d)
date_prevue.order = 40
date_prevue.show_when_type = delivery|action|output|input
date_realisee = text
date_realisee.date = true
date_realisee.date_empty = true
date_realisee.label = Date réalisée (Y-m-d)
date_realisee.order = 99
date_realisee.show_when_type = meeting|risk|document|action|delivery|input|output
#date_realisee.hide_when_type = task|defect|container
date_realisee.clear_on_hide = false
due_assign = text
due_assign.date = true
due_assign.date_empty = true
due_assign.label = Date début (Y-m-d)
due_assign.order = 30
date_realisee.hide_when_type = input|output
model_verif = textarea
model_verif.cols = 83
model_verif.format = wiki
model_verif.label = Relecture du modèle
model_verif.order = 96
model_verif.value = Relecture par XXX le XX/XX/201X sur le modèle XXXXXX. [éventuel commentaire] Bilan de la relecture NON OK/ OK.
model_verif.show_when_type = task
parent = text
parent.format = wiki
parent.label = Parent ID
parent.order = 20
test_verif = textarea
test_verif.cols = 83
test_verif.format = wiki
test_verif.label = Relecture des tests
test_verif.order = 97
test_verif.value = Relecture par XXX le XX/XX/201X sur le modèle XXXXXX. [éventuel commentaire] Bilan de la relecture NON OK/ OK.
test_verif.show_when_type = task
test_verif.clear_on_hide = true
risk_proba = select
risk_proba.label = Probability 
risk_proba.options = |Low|Medium|High
risk_proba.show_when_type = risk
risk_proba.clear_on_hide = true
risk_impact = select
risk_impact.label = Impact 
risk_impact.options = |Weak|Medium|Strong
risk_impact.show_when_type = risk
risk_impact.clear_on_hide = true
version.hide_when_type=risk
ref = text
ref.label= Reference
ref.show_when_type = input|output
version.hide_when_type = input|output|meeting|risk|action

I'll try to migrate to 1.2, but it not so easy has the trac is in production and I don't want to brake things. But I'll set up a local instance to try anyway.

comment:26 Changed 4 years ago by Ryan J Ollos

Thanks, I will test it out soon.

comment:27 Changed 4 years ago by Ryan J Ollos

In 17871:

2.6.0dev: Fix textarea layout with Trac 1.0.x

Refs #8971.

comment:28 Changed 4 years ago by Ryan J Ollos

Resolution: worksformefixed

Confirmed the issue, and should be fixed now.

comment:30 Changed 4 years ago by mathieu@…

I confirm it works.

Thank you very much again for your time and benevolent support !

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.