Notice (8): Undefined index: type [APP/Controller/PiecesController.php, line 501]