From 4dbd72fedd432ff95c30ce9e7a651c9599e86603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 22:22:05 +0100 Subject: [PATCH 1/5] register chillmain in the framework used in tests This should fix travis tests --- Tests/Fixtures/App/app/AppKernel.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Fixtures/App/app/AppKernel.php b/Tests/Fixtures/App/app/AppKernel.php index 2e9b78c1f..332e8e396 100644 --- a/Tests/Fixtures/App/app/AppKernel.php +++ b/Tests/Fixtures/App/app/AppKernel.php @@ -15,6 +15,7 @@ class AppKernel extends Kernel new \Symfony\Bundle\AsseticBundle\AsseticBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Chill\PersonBundle\ChillPersonBundle(), + new Chill\MainBundle\ChillMainBundle() #add here all the required bundle (some bundle are not required) ); } From 7f5e4642181205912ed65984c6aff9b32a8bbab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 22:28:45 +0100 Subject: [PATCH 2/5] Set 'gender' in form as required and remove empty value close #358 --- Form/PersonType.php | 2 +- Form/Type/GenderType.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Form/PersonType.php b/Form/PersonType.php index a6386877d..21f9d2618 100644 --- a/Form/PersonType.php +++ b/Form/PersonType.php @@ -42,7 +42,7 @@ class PersonType extends AbstractType ->add('dateOfBirth', 'date', array('required' => false, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy')) ->add('placeOfBirth', 'text', array('required' => false)) ->add('genre', new GenderType(), array( - 'required' => false + 'required' => true )) ->add('memo', 'textarea', array('required' => false)) ->add('phonenumber', 'textarea', array('required' => false)) diff --git a/Form/Type/GenderType.php b/Form/Type/GenderType.php index 73ac65b9f..c3f348490 100644 --- a/Form/Type/GenderType.php +++ b/Form/Type/GenderType.php @@ -33,7 +33,7 @@ class GenderType extends AbstractType { 'choices' => $a, 'expanded' => true, 'multiple' => false, - 'empty_value' => 'Not given' + 'empty_value' => null )); } From ff3479983e68a05a558991d67d2af1cb647a365b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 22:33:39 +0100 Subject: [PATCH 3/5] add doctrine/doctrine-fixtures-bundle in bundle depedencies --- Tests/Fixtures/App/app/AppKernel.php | 3 ++- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/Fixtures/App/app/AppKernel.php b/Tests/Fixtures/App/app/AppKernel.php index 332e8e396..6bb328454 100644 --- a/Tests/Fixtures/App/app/AppKernel.php +++ b/Tests/Fixtures/App/app/AppKernel.php @@ -15,7 +15,8 @@ class AppKernel extends Kernel new \Symfony\Bundle\AsseticBundle\AsseticBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Chill\PersonBundle\ChillPersonBundle(), - new Chill\MainBundle\ChillMainBundle() + new Chill\MainBundle\ChillMainBundle(), + new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle, #add here all the required bundle (some bundle are not required) ); } diff --git a/composer.json b/composer.json index 338093410..2ce8008fe 100644 --- a/composer.json +++ b/composer.json @@ -28,11 +28,11 @@ "doctrine/common": "2.4.*@dev", "doctrine/doctrine-bundle": "~1.2@dev", "chill-project/main": "*@dev", - "chill-project/custom-fields": "*@dev" + "chill-project/custom-fields": "*@dev", + "doctrine/doctrine-fixtures-bundle": "~2.2" }, "require-dev": { "symfony/dom-crawler": "2.5", - "doctrine/doctrine-fixtures-bundle": "~2.2", "symfony/security": "~2.5" } } From 17fa1baeddd0af4b0200a4949e36e5d9bc7ab357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 22:44:49 +0100 Subject: [PATCH 4/5] add "order by" clause for person search Results are now ordered by lastName, first name (alphabetical) refs #223 --- Search/PersonSearch.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Search/PersonSearch.php b/Search/PersonSearch.php index 812fea242..b970e0462 100644 --- a/Search/PersonSearch.php +++ b/Search/PersonSearch.php @@ -99,7 +99,8 @@ class PersonSearch extends AbstractSearch $dql = 'SELECT p FROM ChillPersonBundle:Person p' . ' WHERE' . ' LOWER(p.firstName) like LOWER(:q)' - . ' OR LOWER(p.lastName) like LOWER(:q)'; + . ' OR LOWER(p.lastName) like LOWER(:q)' + . 'ORDER BY p.lastName, p.firstName'; $query = $this->om->createQuery($dql) ->setParameter('q', '%'.trim($pattern).'%') From 8f5e0423574269193601cf8677ff2beaee615371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 25 Nov 2014 22:58:50 +0100 Subject: [PATCH 5/5] add an index on person firstname and lastname But this index should be lowercase (refs #364) : this should be fixed when we will use doctrine migrations --- Resources/config/doctrine/Person.orm.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Resources/config/doctrine/Person.orm.yml b/Resources/config/doctrine/Person.orm.yml index ec381acbe..c1e9c6e3c 100644 --- a/Resources/config/doctrine/Person.orm.yml +++ b/Resources/config/doctrine/Person.orm.yml @@ -1,6 +1,9 @@ Chill\PersonBundle\Entity\Person: type: entity table: null + indexes: + person_names: + columns: [firstName, lastName] repositoryClass: Chill\PersonBundle\Entity\PersonRepository fields: id: