Permalink
Browse files

added TODO, corrected name

  • Loading branch information...
1 parent 3fc4a54 commit 2c9ed210d890957b0c8ba54b2f32d1419ce389ff @elHornair elHornair committed Feb 27, 2013
Showing with 2 additions and 4 deletions.
  1. +2 −4 Admin/SlideshowItemAdmin.php
@@ -7,21 +7,19 @@
class SlideshowItemAdmin extends Admin
{
-
protected function configureFormFields(FormMapper $formMapper)
{
parent::configureFormFields($formMapper);
// image is only required when creating a new item
+ // TODO: sonata is not using one admin instance per object, so this doesnt really work - fix it
$imageRequired = ($this->getSubject() && $this->getSubject()->getParent()) ? false : true;
$formMapper
->with('form.group_general')
->add('label', 'text')
- ->add('image', 'phpcr_image', array('required' => $imageRequired, 'label' => 'Slide Image', 'data_class' => 'Doctrine\ODM\PHPCR\Document\Image'))
+ ->add('image', 'phpcr_odm_image', array('required' => $imageRequired, 'label' => 'Slide Image', 'data_class' => 'Doctrine\ODM\PHPCR\Document\Image'))
->add('position', 'hidden', array('mapped' => false))
->end();
-
}
-
}

0 comments on commit 2c9ed21

Please sign in to comment.