업데이트 이후 발생한 VOTE 스킨의 에러
CMS/프레임워크 | Rhymix 2.1 |
---|---|
개발 언어 | PHP 7.4 |
modules/vote/skins/bootstrap/vote.html on line 13 (via common/framework/DB.php on line 1311)\n#0
에러가 발생하였습니다.
해당 파일을 공백으로 두면 에러가 나오지 않네요.
{@
$oDB = &DB::getInstance();
$login_votequery = $oDB->_query('select count(*) as count from xe_document_voted_log where document_srl = '.$document_srl.' and member_srl = '.$logged_info->member_srl);
$login_voteresult = $oDB->_fetch($login_votequery);
$ip_votequery = $oDB->_query(sprintf("select count(*) as count from xe_document_voted_log where document_srl = %s and ipaddress = '%s'", $document_srl, getenv('REMOTE_ADDR')));
$ip_voteresult = $oDB->_fetch($ip_votequery);
$ip_query = $oDB->_query(sprintf("select count(*) as count from xe_documents where document_srl = %s and ipaddress = '%s'", $document_srl, getenv('REMOTE_ADDR')));
$ip_result = $oDB->_fetch($ip_query);
$login_query = $oDB->_query('select count(*) as count from xe_documents where document_srl = '.$document_srl.' and member_srl = '.$logged_info->member_srl);
$login_result = $oDB->_fetch($login_query);
}
13번째 행입니다.
추천 문구 관련패치가 있었던데 혹시 관련이 있을까요?

댓글 12
html라인이 정확하다면 쿼리상에 문제가 잇다고 나오는것이거나 변수 관련 문제일텐데 실제로 제일 중요한 에러메세지만 쏙 빼셧네요 에러로그의 에러메세지를 확인해주세요
근데 아마 라이믹스라면 테이블 이름앞에 xe_ 를 쓰지 않으니 지워보세요
답변 감사드립니다.
PHP Exception: TypeError #0 "Return value of Rhymix\\Framework\\DB::_query() must be an instance of Rhymix\\Framework\\Helpers\\DBStmtHelper, bool returned" in modules/vote/skins/bootstrap/vote.html on line 13 (via common/framework/DB.php on line 1311)\n#0 /home/USER/www/files/cache/template/modules/vote/skins/bootstrap/vote.html.php(13): Rhymix\\Framework\\DB->_query()\n#1 /home/USER/www/classes/template/TemplateHandler.class.php(468): include()\n#2 /home/USER/www/classes/template/TemplateHandler.class.php(201): TemplateHandler->_fetch()\n#3 /home/USER/www/modules/vote/vote.controller.php(633): TemplateHandler->compile()\n#4 /home/USER/www/modules/vote/vote.controller.php(596): voteController->_setTemplate()\n#5 /home/USER/www/classes/module/ModuleHandler.class.php(1356): voteController->triggerBeforeDisplay()\n#6 /home/USER/www/classes/display/DisplayHandler.class.php(70): ModuleHandler::triggerCall()\n#7 /home/USER/www/classes/module/ModuleHandler.class.php(1227): DisplayHandler->printContent()\n#8 /home/USER/www/index.php(60): ModuleHandler->displayContent()
로 나오고있습니다.
xe_ 모두 제거해도 에러는 동일하게 발생하네요.
PHP Exception: TypeError #0 "Return value of Rhymix\\Framework\\DB::_query() must be an instance of Rhymix\\Framework\\Helpers\\DBStmtHelper, bool returned" in modules/vote/skins/bootstrap/vote.html on line 13 (via common/framework/DB.php on line 1311)\n#0 /home/USER/www/files/cache/template/modules/vote/skins/bootstrap/vote.html.php(13): Rhymix\\Framework\\DB->_query()\n#1 /home/USER/www/classes/template/TemplateHandler.class.php(468): include()\n#2 /home/USER/www/classes/template/TemplateHandler.class.php(201): TemplateHandler->_fetch()\n#3 /home/USER/www/modules/vote/vote.controller.php(633): TemplateHandler->compile()\n#4 /home/USER/www/modules/vote/vote.controller.php(596): voteController->_setTemplate()\n#5 /home/USER/www/classes/module/ModuleHandler.class.php(1356): voteController->triggerBeforeDisplay()\n#6 /home/USER/www/classes/display/DisplayHandler.class.php(70): ModuleHandler::triggerCall()\n#7 /home/USER/www/classes/module/ModuleHandler.class.php(1227): DisplayHandler->printContent()\n#8 /home/USER/www/index.php(60): ModuleHandler->displayContent()
추천/비추천/신고 모듈
https://xe1.xpressengine.com/index.php?mid=download&package_id=22753651
해당 자료같네요
지금 보니 기본코어에서 제공하는 추천 기능이 아니라
추천 모듈의 스킨이네요.
$ip_votequery = $oDB->_query(sprintf("select count(*) as count from xe_document_voted_log where document_srl = %s and ipaddress = '%s'", $document_srl, getenv('REMOTE_ADDR')));
에서
document_srl = %s 를 document_srl = %d 로 바꿔보세요.
적용해도 동일하네요.
모듈 사용을 점진적으로 포기해야겠네요.
저 위치에서 bool이 반환되어서 자료형 불일치 오류가 났다면 쿼리가 실패했다는 뜻이고, 빨간색으로 표시하신 부분처럼 단순한 쿼리가 실패했다면 document_srl이나 member_srl 등의 값 중 하나가 제대로 들어가지 않아서 아예 문법에 어긋나는 SQL문이 나왔을 가능성이 높습니다. 즉, 원래부터 제대로 작동하지 않는 쿼리였을 테니 그냥 지워버리셔도 무방하지 않을까 싶네요.
https://github.com/rhymix/rhymix/commit/4cf8fc6eb5cbcd2fca196cdc7504781dca8397c5
이렇게 패치하면 문법에 어긋나는 커스텀 쿼리도 치명적인 오류를 뿜지는 않고 그냥 넘어가도록 할 수 있습니다.
적어주신 것처럼 해당 코드를 삭제해도 기능이 작동되어 삭제해버렸습니다.
차차 저모듈 없이 코어 자체의 추천 비추천 신고 기능을 쓰도록해야할것 같습니다.(추천 취소도 되니 오히려 이득ㅎ)
좋아요 훈훈해요 웃겨요 싫어요 화나요 슬퍼요 등등
라이믹스에서 그런 자료는 못 본 것 같죠?
꼼수겠지만 있긴 있습니다 ㅎㅎ 추천확장기능
https://xetown.com/tips/662399
근데 그게 오히려 추천이 연동되어서 기진곰님이 추천을 안하시더라구요
(https://xetown.com/topics/666750#comment_1582892)
저도 이미 적용해뒀는데 차차 제거해버리려구요.
추천 한번누를때 마다 사이트 숫자가 괜시리 올라가버리는것도 아깝기도하고 ㅎㅎ
혹시 구경해보실꺼라면 주소는 제가 예전에 보낸 쪽지 사이트들에 다 적용해놨어요.
https://xetown.com/topics/666750
윤삼님 말처럼 완벽하게 추천과 분리된 독자적인 감정표현 기능이 있다면 좋긴하겠네요. ㅎㅎ
추천과 1:1로 연동되는 것이 목적이라면 그걸 쓰셔도 되겠지요. 링크의 다른 분 피드백처럼, 추천수에 합산되는 것을 원하는 경우도 있으니까요.
반면, 요즘 SNS처럼 한 사람이 엄지척, 하트, 체크 등 여러 가지 리액션을 동시에 붙일 수 있도록 하려면 1인 1회로 제한되는 코어의 추천 기능과 연동시키는 것은 좋지 않습니다. 추천과 연동해서 1인 1리액션 구조로 개발해 놓았다가 나중에 가서 1인 N리액션을 지원하려고 하면 업데이트가 불가능하거나, 추천 연동의 한계를 극복하기 위해 무리한 방법으로 땜빵하게 되거든요.
공감합니다.
추천과는 아무래도 공감은 별개 기능이 맞다고 생각합니다.
처음에는 추천도 되고 일석이조네 생각했는데 ㅎㅎ
막상 실제로 적용해보니 누르는 사람도 잘 없고
나는 분명 감정 표현을 했는데 추천은 이미 했다고 나오고 감정 표현 취소도 못하고
득보다 실이 더 많은 느낌이 들어서
최근에 생각 보니 기진곰님이 적으셨던 댓글처럼 안쓰는게 맞겠다 생각이 들었었습니다.
추천 하나 눌렀는데
db에 기록이되니깐 사이트 게시물 넘버 쓸때마다 혹은 페이지나 모듈이 추가될때마다 올라가는 숫자 그것도 같이 올라가더라구요. 그것도 별건 아니지만 뭔가 기분나쁘더라구요
제가 퓨어한 사이트 상태를 원하는건지
숫자가 늘어난 사이트면 활발한사이트로 보일텐데
여튼 그게 다 글이였으면 좋겠다 하는욕심 때문인지 왜 인진 모르겠네요. ㅎㅎㅎㅎ