<section class="section">
        <h1>권한</h1>
    <div class="x_control-group">
        <label class="x_control-label" for="use">접근 권한</label>
        <div class="x_controls">
            <block loop="$group_list => $key, $val" >
                    <label for="grp_{htmlspecialchars($key)}"  class="mgr14"><input type="checkbox" name="group[]" value="{$val->group_srl}" id="grp_{htmlspecialchars($key)}" checked|cond="in_array($val->group_srl, $config->group)"> {$val->title}</label>
            </block>
            <p class="x_help-block">모두 해제시 전체 사용</p>
        </div>
    </div>
</section>

 

 

checked|cond="in_array($val->group_srl, $config->group)"

 

 

checked|cond="$config->group && in_array($val->group_srl, $config->group)" X

checked|cond="!empty($config->group) && in_array($val->group_srl, $config->group)" X

 

두가지로 시도해 봤는데 에러가 사라지지 않네요. 이경우 어떻게 처리해야 할까요?

사이트의 그룹이 체크박스로 나열이 되고 체크가 되어 있는 상황에서는 에러가 뜨지 않지만 전체 그룹 사용으로 사용하는 모든 체크가 해제 된 경우 에러가 뜹니다.

 

 

이글 등록 버튼을 누르기 전에 코어에서 작성된 부분을 참조해 보니

 

@in_array($val->group_srl, $config->group)

 

@가 붙어 있어서 붙여봤더니 에러가 사라졌습니다. @뭔가요???

 

cond="is_array($config->group) && in_array($val->group_srl, $config->group)" 이런식으로 해도 에러가 사라지네요.

  • profile
    @ 는 에러 메시지를 표시하지 않기 위해 사용합니다.
  • profile profile

    어.. 그럼 이거 php8에 가면 그냥 뻗어 버리는건가요?
    코어나 스킨등에 많이 있던데요....  워닝은 @로 사라졌습니다.

     

    @ 다시 빼고 is_array() && 를 앞쪽에 넣는걸로 다시 다 바꿨습니다. 

    그런데 기존 스킨에 에러 감춰주는 용도로 많이 넣어둔거 같던데 이게 php8 가서 에러로 문제가 되겠네요.

  • profile profile

    scream.enabled = on 옵션이 @를 무시하게 하네요.

  • profile profile
    결론은 옵션 끄고 찾아내서 조치 않아면 php8 에서 문제가 된다는거죠?
  • profile profile

    네 문제가 생겼는데 에러 로그가 안뜨면
    php설정에서 저걸 해주고 오류가 나오는지 체크 해봐야 하는거죠.

     

    그게 아니면 @ 들어간것들은 모두 없애고 해봐도 되고요