Materials API bug fixing

Change-Id: Ie81274936c7cb02746230d6c5f749ebe0e31dedb
This commit is contained in:
smarcet 2019-04-16 15:30:53 -03:00
parent 8691057059
commit 908e24edf1
3 changed files with 6 additions and 7 deletions

View File

@ -691,7 +691,7 @@ final class OAuth2PresentationApiController extends OAuth2ProtectedController
if ($validation->fails()) {
$ex = new ValidationException;
$ex->setMessages($validation->messages()->toArray());
$ex->setMessages($validation->messaupdateSlideges()->toArray());
throw $ex;
}
@ -845,7 +845,6 @@ final class OAuth2PresentationApiController extends OAuth2ProtectedController
'featured' => 'sometimes|required|boolean',
];
$data = $data->all();
// Creates a Validator instance and validates the data.
$validation = Validator::make($data, $rules);

View File

@ -17,12 +17,12 @@
*/
final class PresentationVideoSerializer extends PresentationMaterialSerializer
{
protected static $array_mappings = array
(
'YouTubeID' => 'youtube_id:json_text',
protected static $array_mappings =
[
'YouTubeID' => 'you_tube_id:json_text',
'DateUploaded' => 'data_uploaded:datetime_epoch',
'Highlighted' => 'highlighted:json_boolean',
'Views' => 'views:json_int',
);
];
}

View File

@ -1613,7 +1613,7 @@ SQL;
}
if(empty($photo_url) && !empty($this->getTwitterName()) ){
$twitterName = $this->getTwitterName();
$photoUrl = sprintf("https://avatars.io/twitter/%s", rim(trim($twitterName, '@')));
$photoUrl = sprintf("https://avatars.io/twitter/%s", trim(trim($twitterName, '@')));
}
if(empty($photoUrl)){
$photoUrl = File::getCloudLinkForImages("generic-speaker-icon.png");