Skip to content

Commit

Permalink
Merge pull request #42 from NetCommons3/bugfix
Browse files Browse the repository at this point in the history
Update Nc2ToNc3RegistrationBehavior.php
  • Loading branch information
akagane99 committed Dec 14, 2018
2 parents 05e6153 + f5c99e8 commit 5648618
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Model/Behavior/Nc2ToNc3RegistrationBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,16 @@ private function __generateNc3RegistrationChoiceData($nc2Item) {
$data = [];
$nc3ChoiceSequence = 0;
foreach ($nc2Choices as $nc2Choice) {
// NC2ではOKだった全角空白のみの選択肢も、NC3ではRegistrationChoiceモデルでvalidateエラーになるため、セットしない。
// @see https://github.com/NetCommons3/Registrations/blob/master/Model/RegistrationChoice.php#L80-L89
$checkEmpty = str_replace([' ', ' '], '', $nc2Choice);
if ($checkEmpty == '') {
continue;
}
// NC2ではOKだった「:」「|」を含む選択肢も、NC3ではRegistrationChoiceモデルでvalidateエラーになるため、全角に置換してセットする。
$nc2Choice = str_replace(':', ':', $nc2Choice);
$nc2Choice = str_replace('|', '|', $nc2Choice);

$data[] = [
'choice_sequence' => $nc3ChoiceSequence,
'choice_label' => $nc2Choice,
Expand Down

0 comments on commit 5648618

Please sign in to comment.