Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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. :)

In reply to Class::DBI misbehaviour by TVSET

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-19 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found