| @@ -480,8 +480,20 @@ | ||
| 480 | 480 | { |
| 481 | 481 | $result = $dbo->insertObject($this->_table, $this, $this->_tableKeys[0]); |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | + /** | |
| 485 | + * The table is now able to propagate the error message faced during | |
| 486 | + * the database insert/update execution. | |
| 487 | + * | |
| 488 | + * @since 10.1.58 | |
| 489 | + */ | |
| 490 | + if (!$result) | |
| 491 | + { | |
| 492 | + // propagate error message | |
| 493 | + $this->setError($dbo->getLastError() ?: 'Database query error.'); | |
| 494 | + } | |
| 495 | + | |
| 484 | 496 | // post-processing by observers |
| 485 | 497 | $event->trigger('onAfterStore', array(&$result)); |
| 486 | 498 | |
| 487 | 499 | return $result; |