From b1e9f430b4c9048240d103aba381822e1bdc5fc9 Mon Sep 17 00:00:00 2001 From: Sebastian Marcet Date: Mon, 21 Nov 2016 11:39:26 -0300 Subject: [PATCH] Bug Fix Removed all references to Summit Type from model Change-Id: I85f050e6384e9b3f51140ee632df72078833943d --- app/Console/Commands/SummitJsonGenerator.php | 2 +- .../summit/OAuth2SummitApiController.php | 10 +- app/Http/routes.php | 4 +- .../Foundation/Summit/Events/SummitEvent.php | 13 -- .../DoctrineSummitEventRepository.php | 6 - composer.lock | 114 +++++++++--------- tests/OAuth2SummitApiTest.php | 5 - 7 files changed, 61 insertions(+), 93 deletions(-) diff --git a/app/Console/Commands/SummitJsonGenerator.php b/app/Console/Commands/SummitJsonGenerator.php index 9b094ec4..cc61d9a1 100644 --- a/app/Console/Commands/SummitJsonGenerator.php +++ b/app/Console/Commands/SummitJsonGenerator.php @@ -94,7 +94,7 @@ final class SummitJsonGenerator extends Command { $this->info(sprintf("processing summit id %s", $summit->getIdentifier())); $start = time(); - $expand = 'locations,sponsors,summit_types,event_types,presentation_categories,schedule'; + $expand = 'locations,sponsors,event_types,presentation_categories,schedule'; $data = SerializerRegistry::getInstance()->getSerializer($summit)->serialize($expand); if(is_null($data)) return; diff --git a/app/Http/Controllers/apis/protected/summit/OAuth2SummitApiController.php b/app/Http/Controllers/apis/protected/summit/OAuth2SummitApiController.php index f807afe4..3615fbec 100644 --- a/app/Http/Controllers/apis/protected/summit/OAuth2SummitApiController.php +++ b/app/Http/Controllers/apis/protected/summit/OAuth2SummitApiController.php @@ -218,16 +218,8 @@ final class OAuth2SummitApiController extends OAuth2ProtectedController public function getSummitTypes($summit_id) { try { - $summit = SummitFinderStrategyFactory::build($this->repository)->find($summit_id); - if (is_null($summit)) return $this->error404(); - //summit types - $summit_types = array(); - foreach ($summit->getSummitTypes() as $summit_type) - { - $summit_types[] =SerializerRegistry::getInstance()->getSerializer($summit_type)->serialize(); - } - return $this->ok($summit_types); + return $this->ok(); } catch (Exception $ex) { Log::error($ex); diff --git a/app/Http/routes.php b/app/Http/routes.php index 00999740..82a18cc0 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -148,9 +148,9 @@ Route::group(array( }); // summit types - Route::group(array('prefix' => 'summit-types'), function () { + /*Route::group(array('prefix' => 'summit-types'), function () { Route::get('', 'OAuth2SummitApiController@getSummitTypes'); - }); + });*/ // summit types Route::group(array('prefix' => 'external-orders'), function () { diff --git a/app/Models/Foundation/Summit/Events/SummitEvent.php b/app/Models/Foundation/Summit/Events/SummitEvent.php index efc0e701..60607035 100644 --- a/app/Models/Foundation/Summit/Events/SummitEvent.php +++ b/app/Models/Foundation/Summit/Events/SummitEvent.php @@ -499,16 +499,6 @@ class SummitEvent extends SilverstripeBaseModel return $this->location; } - /** - * @return array - */ - public function getSummitTypesIds() - { - return $this->summit_types->map(function($entity) { - return $entity->getId(); - })->toArray(); - } - /** * @return array */ @@ -616,9 +606,6 @@ class SummitEvent extends SilverstripeBaseModel if($this->isPublished()) throw new ValidationException('Already published Summit Event'); - if($this->getSummitTypes()->count() === 0) - throw new EntityValidationException('To publish this event you must associate a valid summit type!'); - $start_date = $this->getStartDate(); $end_date = $this->getEndDate(); diff --git a/app/Repositories/Summit/Doctrine/DoctrineSummitEventRepository.php b/app/Repositories/Summit/Doctrine/DoctrineSummitEventRepository.php index e65a1f72..861e2934 100644 --- a/app/Repositories/Summit/Doctrine/DoctrineSummitEventRepository.php +++ b/app/Repositories/Summit/Doctrine/DoctrineSummitEventRepository.php @@ -81,12 +81,6 @@ final class DoctrineSummitEventRepository extends SilverStripeDoctrineRepository 't', "t.tag :operator ':value'" ), - 'summit_type_id'=> new DoctrineJoinFilterMapping - ( - 'e.summit_types', - 'st', - "st.id :operator :value" - ), 'location_id'=> new DoctrineJoinFilterMapping ( 'e.location', diff --git a/composer.lock b/composer.lock index 8ebcbb9b..4f1bf164 100644 --- a/composer.lock +++ b/composer.lock @@ -2184,7 +2184,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2428,16 +2428,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", "shasum": "" }, "require": { @@ -2449,7 +2449,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2483,20 +2483,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-php55", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d" + "reference": "03e3f0350bca2220e3623a0e340eef194405fc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", - "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/03e3f0350bca2220e3623a0e340eef194405fc67", + "reference": "03e3f0350bca2220e3623a0e340eef194405fc67", "shasum": "" }, "require": { @@ -2506,7 +2506,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2539,20 +2539,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-php56", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" + "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/1dd42b9b89556f18092f3d1ada22cb05ac85383c", + "reference": "1dd42b9b89556f18092f3d1ada22cb05ac85383c", "shasum": "" }, "require": { @@ -2562,7 +2562,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2595,20 +2595,20 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/polyfill-util", - "version": "v1.2.0", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" + "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/746bce0fca664ac0a575e465f65c6643faddf7fb", + "reference": "746bce0fca664ac0a575e465f65c6643faddf7fb", "shasum": "" }, "require": { @@ -2617,7 +2617,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2647,7 +2647,7 @@ "polyfill", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-11-14 01:06:16" }, { "name": "symfony/process", @@ -2775,16 +2775,16 @@ }, { "name": "symfony/serializer", - "version": "v2.8.13", + "version": "v2.8.14", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "fad6992cd308b6c2484186fd980b221ebcb0ed37" + "reference": "df9a4f82143668c2f775cc85e1972044c9e93d4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/fad6992cd308b6c2484186fd980b221ebcb0ed37", - "reference": "fad6992cd308b6c2484186fd980b221ebcb0ed37", + "url": "https://api.github.com/repos/symfony/serializer/zipball/df9a4f82143668c2f775cc85e1972044c9e93d4d", + "reference": "df9a4f82143668c2f775cc85e1972044c9e93d4d", "shasum": "" }, "require": { @@ -2835,7 +2835,7 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2016-09-24 09:47:20" + "time": "2016-11-03 07:52:58" }, { "name": "symfony/translation", @@ -3111,16 +3111,16 @@ }, { "name": "mockery/mockery", - "version": "0.9.5", + "version": "0.9.6", "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2" + "reference": "65d4ca18e15cb02eeb1e5336f884e46b9b905be0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/4db079511a283e5aba1b3c2fb19037c645e70fc2", - "reference": "4db079511a283e5aba1b3c2fb19037c645e70fc2", + "url": "https://api.github.com/repos/padraic/mockery/zipball/65d4ca18e15cb02eeb1e5336f884e46b9b905be0", + "reference": "65d4ca18e15cb02eeb1e5336f884e46b9b905be0", "shasum": "" }, "require": { @@ -3172,7 +3172,7 @@ "test double", "testing" ], - "time": "2016-05-22 21:52:33" + "time": "2016-09-30 12:09:40" }, { "name": "phpdocumentor/reflection-common", @@ -3578,16 +3578,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", + "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", "shasum": "" }, "require": { @@ -3623,20 +3623,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2016-11-15 14:06:22" }, { "name": "phpunit/phpunit", - "version": "4.8.27", + "version": "4.8.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" + "reference": "f19d481b468b76a7fb55eb2b772ed487e484891e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", - "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f19d481b468b76a7fb55eb2b772ed487e484891e", + "reference": "f19d481b468b76a7fb55eb2b772ed487e484891e", "shasum": "" }, "require": { @@ -3652,7 +3652,7 @@ "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "~1.2.2", "sebastian/diff": "~1.2", "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", @@ -3695,7 +3695,7 @@ "testing", "xunit" ], - "time": "2016-07-21 06:48:14" + "time": "2016-11-20 10:35:28" }, { "name": "phpunit/phpunit-mock-objects", @@ -3755,22 +3755,22 @@ }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", + "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -3815,7 +3815,7 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2016-11-19 09:18:40" }, { "name": "sebastian/diff", @@ -4236,16 +4236,16 @@ }, { "name": "symfony/yaml", - "version": "v3.1.6", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27" + "reference": "9da375317228e54f4ea1b013b30fa47417e84943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7ff51b06c6c3d5cc6686df69004a42c69df09e27", - "reference": "7ff51b06c6c3d5cc6686df69004a42c69df09e27", + "url": "https://api.github.com/repos/symfony/yaml/zipball/9da375317228e54f4ea1b013b30fa47417e84943", + "reference": "9da375317228e54f4ea1b013b30fa47417e84943", "shasum": "" }, "require": { @@ -4281,7 +4281,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-10-24 18:41:13" + "time": "2016-11-18 21:05:29" }, { "name": "webmozart/assert", diff --git a/tests/OAuth2SummitApiTest.php b/tests/OAuth2SummitApiTest.php index a5dd2e57..af26299e 100644 --- a/tests/OAuth2SummitApiTest.php +++ b/tests/OAuth2SummitApiTest.php @@ -844,7 +844,6 @@ final class OAuth2SummitApiTest extends ProtectedApiTest 'start_date' => $start_date, 'end_date' => $end_date, 'type_id' => 95, - 'summit_types_id' => [10], 'tags' => ['Neutron'] ); @@ -886,7 +885,6 @@ final class OAuth2SummitApiTest extends ProtectedApiTest 'description' => 'test presentation BCN', 'allow_feedback' => true, 'type_id' => 86, - 'summit_types_id' => [7], 'tags' => ['tag#1', 'tag#2'] ); @@ -924,7 +922,6 @@ final class OAuth2SummitApiTest extends ProtectedApiTest 'description' => 'test presentation BCN', 'allow_feedback' => true, 'type_id' => 86, - 'summit_types_id' => [7], 'tags' => ['tag#1', 'tag#2'], 'speakers' => [1, 2, 3], ); @@ -953,7 +950,6 @@ final class OAuth2SummitApiTest extends ProtectedApiTest public function testUpdateEvent() { /*$event = $this->testPostEvent(); - unset($event->summit_types); unset($event->tags);*/ $params = array ( @@ -996,7 +992,6 @@ final class OAuth2SummitApiTest extends ProtectedApiTest public function testPublishEvent($start_date = 1461520800, $end_date = 1461526200) { $event = $this->testPostEvent($start_date, $end_date); - unset($event->summit_types); unset($event->tags); $params = array