diff --git a/application/controllers/api/frontend/v1/stv/Student.php b/application/controllers/api/frontend/v1/stv/Student.php index 0cfd82c36..f2845572f 100644 --- a/application/controllers/api/frontend/v1/stv/Student.php +++ b/application/controllers/api/frontend/v1/stv/Student.php @@ -276,7 +276,17 @@ class Student extends FHCAPI_Controller $update_person = array(); foreach ($array_allowed_props_person as $prop) { $val = $this->input->post($prop); - if ($val !== null) { + if ($val === null) + { + continue; + } + if($prop == 'foto') + { + $fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val); + $update_person[$prop] = $fotoval; + } + else + { $update_person[$prop] = $val; } } diff --git a/public/js/components/DetailHeader/DetailHeader.js b/public/js/components/DetailHeader/DetailHeader.js index 5c1573753..1088e3f63 100644 --- a/public/js/components/DetailHeader/DetailHeader.js +++ b/public/js/components/DetailHeader/DetailHeader.js @@ -102,6 +102,13 @@ export default { redirectToLeitung(){ this.$emit('redirectToLeitung', { person_id: this.leitungData.person_id}); + }, + getFotoSrc(foto) { + if(foto === null) { + return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'skin/images/profilbild_dummy.jpg'; + } else { + return 'data:image/jpeg;base64,' + foto; + } } }, template: ` @@ -116,7 +123,7 @@ export default { Profilbild