plainblack.com
Username Password
search
Bookmark and Share
View All Tickets
Mismatch in YesNo.pm and Asset.pm  (#10081)
Issue

The Asset/Wobject/YesNo.pm is supposed to allow choosing which of the choices is defaulted when the page is displayed. This is not working at the call to getOriginalValue in the toHtml code is being passed up to the Asset superclass. The implementation of this superclass does not 'do the right thing'. The obvious fix would be to change the Asset::getOriginalValue implementation call the getValue function. This breaks other Wobjects (Submit is the one I found)

The alternative is to add an implementation of getOriginalValue into YesNo as shown here. While this works the proper solution would be a better approach but it would need all Wobjects examining.

sub getOriginalValue {
  my $self = shift;
  my $value = $self->getValue;
  return $value if (defined $value);
  return $self->getDefaultValue;
}

 

Solution Summary
Comments
howard@cohtech.com
0
4/1/2009 12:09 pm
Oops got confused with another item I have been looking at! This should have referred to Form/YesNo.pm and Form/Control.pm.

However, further testing shows that this solution does not work so back to the drawing board.
howard@cohtech.com
0
4/1/2009 12:58 pm
Worked out what the real code should be try this in side YesNo.pm

sub getOriginalValue {
 my $self = shift;
 my $value = $self->SUPER::getOriginalValue;
 return ($value =~ /^y/i || $value eq '1') ? 1 : 0;
}
perlDreamer
4
4/2/2009 12:25 pm
Can you please attach some example form code where you see this failing?
JT
0
4/14/2009 1:52 pm
Feedback Requested by JT
perlDreamer
0
6/3/2009 3:23 pm
Closing as not a bug, and no user feedback.  You can reopen the bug with new information by adding a new comment to this bug.
Resolved by perlDreamer
Details
Ticket Status Resolved  
Rating4.0 
Submitted Byhoward@cohtech.com 
Date Submitted2009-04-01 
Assigned To unassigned  
Date Assigned2019-05-21 
Assigned By 
Severity Critical (mostly not working)  
What's the bug in? WebGUI Stable  
WebGUI / WRE Version 7.6.13  
URLbugs/tracker/10081
Keywords
Ticket History
6/3/2009
8:24 PM
Resolved perlDreamer
4/14/2009
6:52 PM
Feedback Requested JT
4/1/2009
4:50 PM
Ticket created howard@cohtech.com
© 2019 Plain Black Corporation | All Rights Reserved