Skip to content

Commit

Permalink
[BF] Bug introduced regarding uniqueness of monitor index
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Sep 3, 2014
1 parent 3011e56 commit d43efea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/controllers/PhysicalInterfaceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ protected function addPostValidate( $form, $object, $isEdit )
$vi = $this->getD2EM()->getRepository( '\\Entities\\VirtualInterface' )->find( $form->getElement( 'virtualinterfaceid' )->getValue() );
$object->setVirtualInterface( $vi );

if( !$vi->getCustomer()->isUniqueMonitorIndex( $form->getValue( 'monitorindex' ) ) ) {
// FIXME We should do more than just ensure it's not an edit here. You could edit to a non-unique value...
if( !$isEdit && !$vi->getCustomer()->isUniqueMonitorIndex( $form->getValue( 'monitorindex' ) ) ) {
$this->addMessage( 'The monitor index must be unique. It has been reset below to a unique value.', OSS_Message::ERROR );
$form->getElement( 'monitorindex' )->setValue( $this->getD2R( '\\Entities\\PhysicalInterface' )->getNextMonitorIndex( $vi->getCustomer() ) );
return false;
Expand Down

0 comments on commit d43efea

Please sign in to comment.