Changeset 328
- Timestamp:
- 08/11/09 04:41:45 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r325 r328 292 292 if ($inline{$field}) { 293 293 # TODO check fields exists ! 294 push(@fields, sprintf("%s = ?", $self->db->quote_identifier($field)));295 push(@vals, $data{$field});294 push(@fields, sprintf("%s = ?", $self->db->quote_identifier($field))); 295 push(@vals, $data{$field}); 296 296 } else { 297 297 $ext{$field} = $data{$field}; … … 307 307 ) 308 308 ); 309 $sth->execute(@vals, $self->id) or return; 309 $sth->execute(@vals, $self->id) or do { 310 $self->base->log(LA_ERR, "Cannot update inline field %s" . 311 $self->base->db->strerr); 312 return; 313 }; 310 314 } 311 315 … … 332 336 my $okey = $self->_get_ikey($self->base, $self->id); 333 337 foreach (keys %ext) { 338 warn "$_ $ext{$_}"; 334 339 if ($ext{$_}) { 335 $sthu->execute($ext{$_}, $okey, $_) != 0 || 336 $sthx->execute($okey, $_, $ext{$_}) or return; 340 my $res = $sthu->execute($ext{$_}, $okey, $_); 341 defined($res) or do { 342 $self->base->log(LA_ERR, 343 "Error while udapting attributes: %s", 344 $self->base->db->strerr 345 ); 346 return; 347 }; 348 if ($res == 0) { 349 $res = $sthx->execute($okey, $_, $ext{$_}); 350 defined($res) or do { 351 $self->base->log(LA_ERR, 352 "Error while udapting attributes: %s", 353 $self->base->db->strerr 354 ); 355 return; 356 }; 357 } 337 358 } else { 338 $sthd->execute($okey, $_) or return; 359 defined($sthd->execute($okey, $_)) or do { 360 $self->base->log(LA_ERR, 361 "Error while deleting attributes: %s", 362 $self->base->db->strerr 363 ); 364 return; 365 }; 339 366 } 340 367 }
Note: See TracChangeset
for help on using the changeset viewer.