Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add translation, remove depracated, fix view #13

Merged
merged 2 commits into from
May 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Form/EventListener/BuildTaxonFormListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Sylius\Bundle\TaxonomiesBundle\Form\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\Event\DataEvent;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormFactoryInterface;

Expand Down Expand Up @@ -54,9 +54,9 @@ public static function getSubscribedEvents()
/**
* Builds proper taxon form after setting the product.
*
* @param DataEvent $event
* @param FormEvent $event
*/
public function preSetData(DataEvent $event)
public function preSetData(FormEvent $event)
{
$taxon = $event->getData();
$form = $event->getForm();
Expand All @@ -68,18 +68,19 @@ public function preSetData(DataEvent $event)
$taxonomy = $taxon->getTaxonomy();

$form->add($this->factory->createNamed('parent', 'sylius_taxon_choice', $taxon->getParent(), array(
'taxonomy' => $taxonomy,
'required' => false,
'empty_value' => '---'
)));
'taxonomy' => $taxonomy,
'required' => false,
'label' => 'sylius.form.taxon.parent',
'empty_value' => '---'
)));
}

/**
* Reset the taxon root if it's null.
*
* @param DataEvent $event
* @param FormEvent $event
*/
public function postBind(DataEvent $event)
public function postBind(FormEvent $event)
{
$taxon = $event->getData();
$form = $event->getForm();
Expand Down