Hello All.
I've encountered a very strange behavior from Class::DBI. It does work with the rest of the project, but in this particular case it simply doesn't and I cannot find any changes that I did that could cause it.
No errors or warning appear, code executes just fine, but the database is not updated.
I've readmore-ed the details to protect the innocent. :)
Here are the definitions:
use base 'Intranet::DBI';
__PACKAGE__->table('noc_schedule');
__PACKAGE__->columns(Primary => qw/id/);
__PACKAGE__->columns(Essential => qw/
caption
starts
ends
active
locked
monday
tuesday
wednesday
thursday
friday
saturday
sunday
holiday
last_modified
/);
Here is the relevant peice of code:
unless (@errors) {
my $shift = $self->retrieve($args->{'id'});
print "DEBUG(before update): ",Dumper($shift),"<BR>\n";
$shift->caption($args->{'caption'});
$shift->starts($args->{'starts'});
$shift->ends($args->{'ends'});
$shift->monday($args->{'monday'});
$shift->tuesday($args->{'tuesday'});
$shift->wednesday($args->{'wednesday'});
$shift->thursday($args->{'thursday'});
$shift->friday($args->{'friday'});
$shift->saturday($args->{'saturday'});
$shift->sunday($args->{'sunday'});
$shift->holiday($args->{'holiday'});
print "DEBUG(while update): ",Dumper($shift),"<BR>\n";
$shift->update;
print "DEBUG(after update): ",Dumper($shift),"<BR>\n";
}
And here is the output of those Dumpers:
DEBUG(before update): $VAR1 = bless( { 'holiday' => '16', 'sunday' =>
+'16', 'locked' => '0', 'friday' => '18', 'last_modified' => '20040311
+080038', 'active' => '0', 'tuesday' => '18', 'monday' => '18', 'ends'
+ => '22:59:00', 'starts' => '22:58:00', 'caption' => 'Copy of Other',
+ 'saturday' => '16', 'wednesday' => '18', 'thursday' => '18', 'id' =>
+ '21' }, 'Intranet::NOC::Shift' );
DEBUG(while update): $VAR1 = bless( { 'holiday' => '16', 'sunday' => '
+16', 'locked' => '0', 'friday' => '18', 'last_modified' => '200403110
+80038', 'active' => '0', 'tuesday' => '18', 'monday' => '18', 'ends'
+=> '15:00:00', 'starts' => '13:00:00', 'caption' => 'test', 'saturday
+' => '16', 'wednesday' => '18', 'thursday' => '18', '__Changed' => {
+'holiday' => 1, 'sunday' => 1, 'starts' => 1, 'caption' => 1, 'saturd
+ay' => 1, 'friday' => 1, 'wednesday' => 1, 'thursday' => 1, 'tuesday'
+ => 1, 'monday' => 1, 'ends' => 1 }, 'id' => '21' }, 'Intranet::NOC::
+Shift' );
DEBUG(after update): $VAR1 = bless( { 'locked' => '0', 'last_modified'
+ => '20040311080038', 'active' => '0', 'id' => '21' }, 'Intranet::NOC
+::Shift' );
Any help with this will be greatly appreciate, because I, for one, am going totally nuts. :)