Fix on CFP presentation submission proccess

Change-Id: Ibb1f69d16651e998140f2f5924e11c6abfae480a
This commit is contained in:
Sebastian Marcet 2018-09-27 11:42:42 -03:00
parent aebbcd1bd4
commit d6dad95b48
2 changed files with 7 additions and 6 deletions

View File

@ -290,10 +290,10 @@ class PresentationCategory extends SilverstripeBaseModel
* @return Tag|null
*/
public function getAllowedTagByVal($tag_value){
$criteria = Criteria::create();
$criteria->where(Criteria::expr()->eq('tag', trim($tag_value)));
$res = $this->allowed_tags->matching($criteria)->first();
return $res === false ? null : $res;
$res = $this->allowed_tags->filter(function($e) use($tag_value){
return strtolower(trim($e->getTag())) == strtolower(trim($tag_value));
});
return $res->count() > 0 ? $res->first() : null;
}
/**

View File

@ -31,7 +31,7 @@ class OAuth2PresentationSubmissionTest extends ProtectedApiTest
'level' => 'N/A',
'attendees_expected_learnt' => 'super duper',
'type_id' => 171,
'track_id' => 248,
'track_id' => 262,
'attending_media' => true,
'links' => ['https://www.google.com'],
'extra_questions' => [
@ -39,7 +39,8 @@ class OAuth2PresentationSubmissionTest extends ProtectedApiTest
'id' => 24,
'value' => 'test',
]
]
],
'tags' => ['Upstream Development']
];
$headers = [