Fix for member speaker assignment
Change-Id: I20663529b51b33a5ab1239d6d5d360bfad9fa115
This commit is contained in:
parent
a9a4819623
commit
d75687272b
@ -27,6 +27,7 @@ use App\Models\Foundation\Summit\Speakers\SpeakerEditPermissionRequest;
|
|||||||
use App\Services\Model\AbstractService;
|
use App\Services\Model\AbstractService;
|
||||||
use App\Services\Model\IFolderService;
|
use App\Services\Model\IFolderService;
|
||||||
use Illuminate\Http\UploadedFile;
|
use Illuminate\Http\UploadedFile;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use libs\utils\ITransactionService;
|
use libs\utils\ITransactionService;
|
||||||
use models\exceptions\EntityNotFoundException;
|
use models\exceptions\EntityNotFoundException;
|
||||||
@ -210,8 +211,14 @@ final class SpeakerService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($member_id == 0 && !empty($emai)) {
|
if ($member_id == 0 && !empty($emai)) {
|
||||||
|
Log::debug(sprintf("SpeakerService::addSpeaker: member id is zero email is %s", $emai));
|
||||||
$member = $this->member_repository->getByEmail($email);
|
$member = $this->member_repository->getByEmail($email);
|
||||||
|
if (!is_null($member)) {
|
||||||
|
Log::debug(sprintf("SpeakerService::addSpeaker: member %s found, setting it to speaker", $emai));
|
||||||
|
$speaker->setMember($member);
|
||||||
|
}
|
||||||
if (is_null($member)) {
|
if (is_null($member)) {
|
||||||
|
Log::debug(sprintf("SpeakerService::addSpeaker: member %s not found", $emai));
|
||||||
$existent_speaker = $this->speaker_repository->getByMember($member);
|
$existent_speaker = $this->speaker_repository->getByMember($member);
|
||||||
if (!is_null($existent_speaker))
|
if (!is_null($existent_speaker))
|
||||||
throw new ValidationException
|
throw new ValidationException
|
||||||
@ -223,11 +230,6 @@ final class SpeakerService
|
|||||||
])
|
])
|
||||||
|
|
||||||
);
|
);
|
||||||
$speaker->setMember($member);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$speaker->hasMember()){
|
|
||||||
$this->registerSpeaker($speaker, $email);
|
$this->registerSpeaker($speaker, $email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ use App\Models\Foundation\Summit\Factories\TrackTagGroupFactory;
|
|||||||
use App\Models\Foundation\Summit\Repositories\IDefaultTrackTagGroupRepository;
|
use App\Models\Foundation\Summit\Repositories\IDefaultTrackTagGroupRepository;
|
||||||
use App\Models\Foundation\Summit\TrackTagGroup;
|
use App\Models\Foundation\Summit\TrackTagGroup;
|
||||||
use App\Models\Foundation\Summit\TrackTagGroupAllowedTag;
|
use App\Models\Foundation\Summit\TrackTagGroupAllowedTag;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use libs\utils\ITransactionService;
|
use libs\utils\ITransactionService;
|
||||||
use models\exceptions\EntityNotFoundException;
|
use models\exceptions\EntityNotFoundException;
|
||||||
use models\exceptions\ValidationException;
|
use models\exceptions\ValidationException;
|
||||||
@ -165,9 +166,13 @@ implements ISummitTrackTagGroupService
|
|||||||
if (isset($data['allowed_tags'])) {
|
if (isset($data['allowed_tags'])) {
|
||||||
$track_tag_group->clearAllowedTags();
|
$track_tag_group->clearAllowedTags();
|
||||||
foreach ($data['allowed_tags'] as $str_tag) {
|
foreach ($data['allowed_tags'] as $str_tag) {
|
||||||
|
Log::debug("updating allowed tags for track group");
|
||||||
|
Log::debug(sprintf("trying to get tag %s ...", $str_tag));
|
||||||
$tag = $this->tag_repository->getByTag($str_tag);
|
$tag = $this->tag_repository->getByTag($str_tag);
|
||||||
if(is_null($tag))
|
if(is_null($tag)) {
|
||||||
|
Log::debug(sprintf("creating tag %s ...", $str_tag));
|
||||||
$tag = new Tag(trim($str_tag));
|
$tag = new Tag(trim($str_tag));
|
||||||
|
}
|
||||||
$track_tag_group->addTag($tag);
|
$track_tag_group->addTag($tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ final class OAuth2TrackTagGroupsApiTest extends ProtectedApiTest
|
|||||||
//$new_track_tag_group = $this->testAddTrackTagGroup($summit_id);
|
//$new_track_tag_group = $this->testAddTrackTagGroup($summit_id);
|
||||||
$params = [
|
$params = [
|
||||||
'id' => $summit_id,
|
'id' => $summit_id,
|
||||||
'track_tag_group_id' => 26,
|
'track_tag_group_id' => 25,
|
||||||
'expand' => 'allowed_tags,tag'
|
'expand' => 'allowed_tags,tag'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ final class OAuth2TrackTagGroupsApiTest extends ProtectedApiTest
|
|||||||
'name' => $name,
|
'name' => $name,
|
||||||
'label' => $label,
|
'label' => $label,
|
||||||
'order' => 1,
|
'order' => 1,
|
||||||
'allowed_tags' => ['101','Case Study', 'Demo', 'Demo2'],
|
'allowed_tags' => ['Symantec','Platinum Member', 'Marketplace', 'Enterprise', 'Tag Loco'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user