• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item3685: Hidden mandatory form fields are no longer hidden in 4.1.1

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Forms Urgent Closed   patch 4.1.2

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

I have a form that has Hidden, Mandatory attributes (HM).

In the previous version (4.0.5), these fields were hidden along with the Hidden only (H) fields.

In version 4.1.1 these fields now appear on the page.

-- TWiki:Main/DuncanKinnear - 25 Feb 2007

If this one is a simple logical error in the code then I would like the fix included in 4.1.2.

It is a small but annoying new bug.

-- TWiki:Main.KennethLavrsen - 26 Feb 2007

M,H does work.

-- TWiki:Main.ArthurClemens - 26 Feb 2007

On 4.0.5 any combination of H and M seems to work. So the HM fields are showing at edit time but are hidden at view time.

-- TWiki:Main.StephaneLenclud - 26 Feb 2007

Arthur,

Thanks, adding the comma does indeed work. However, all older topics that have the appropriate form attached to them still show the fields.

In fact, it's worse than that. I just looked at an older topic that has not been touched since we upgraded to 4.1.1 and ALL the fields are visible, not just the mandatory ones.

Sure, if I Edit the topic and then re-Save it without modification, the fields disappear, but I wouldn't like to have to do that for all topics with Forms that have hidden fields. And we've only just started using TWiki, so we don't have that many yet.

-- TWiki:Main.DuncanKinnear - 26 Feb 2007

It is SVN 11839 (Thomas Weigert) that broke this.

-- TWiki:Main.KennethLavrsen - 27 Feb 2007

$field->{attributes} returns "HM", not "H M".

I bet Thomas only tested with one attribute and not two

-- TWiki:Main.KennethLavrsen - 27 Feb 2007

I looked at the code and it seems to be a half implemented future feature which breaks the function for both mandatory and hidden attribute when they are combined.

It is unacceptable that people have to put a comma between the two. It is not enough to update forms. All topics must be opened and saved which in our case means 1000s.

So I simply revert the change implemented in SVN 11839 and updated the unit test cases.

If Thomas wants to persue the change then please test it more carefully and please maintain compatibility.

Existing topics with both mandatory and hidden fields defined have these stored as either "HM" or "MH" in the topic. Ie. no spaces or commas. Reverting also means removing the unused new mandatory meta attribute which I do not remember being accepted by anyone.

-- TWiki:Main.KennethLavrsen - 27 Feb 2007

Well, just sticking MH into the attribute field was not really the intended usage, and is not documented in the specification. Admitedly, the specification does not really state any detail, so I agree that a user could be confused. So just because something worked before by accident does not mean that is the specification.

I shall attend to this. -- TW

TWikiForms#Structure_of_a_Form_Template says

Attributes specifies special attributes for the field. Multiple attributes can be entered, separated by spaces.
  • An attribute H indicates that this field should not be shown in view mode. However, the field is available for editing and storing information.
  • An attribute M indicates that this field is mandatory. The topic cannot be saved unless a value is provided for this field. If the field is found empty during topic save, an error is raised and the user is redirected to an oops page. Mandatory fields are indicated by an asterisks next to the field name.

So the combination of M and H is documented and must work and your code change broke this. And I had to fix it for release 4.1.2.

This is the definition in the Form topic. When the form is used on a topic - TWiki stores - and always stored in previous versions of TWiki - the actual meta without the space. I think this is pretty clear from the reporters above in this bug item and from my analysis.

And the code change you made cannot cope with this because $field->{attributes} returns "HM" and not two values "H" and "M".

No user has been confused here and the spec is very clear for how the user should define the form attributes - "seperared by spaces". And you clearly did not test the combination ever.

And whatever enhancements are made to the attribute build must be backwards compatible with the 10000s of topics out there among current installations where a mandatory hidden field has the meta looking like

%META:FIELD{name="Hiddenfield" attributes="MH" title="Hiddenfield" value="Some value"}%

As I had a release deadline to meet I had no other option than to restore the old working code and I will do that again without any hesitation. My job as release manager is to create patch releases with as much stability and as little bugs as possible.

I am closing this bug report.

We do not reuse old bug reports. This bug report covers the issue with the combined H and M not working.

If you want to enhance the form attributes then please open a new bug item.

We need to maintain proper traceability. And when people arrive to this bug item from the release note the bug item must cover just one bug.

KJL]

ItemTemplate
Summary Hidden mandatory form fields are no longer hidden in 4.1.1
ReportedBy TWiki:Main.DuncanKinnear
Codebase 4.1.1
SVN Range TWiki-4.1.1, Tue, 20 Feb 2007, build 12932
AppliesTo Engine
Component Forms
Priority Urgent
CurrentState Closed
WaitingFor

Checkins 12976 12977
TargetRelease patch
ReleasedIn 4.1.2
Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 2007-03-04 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback