New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
コミュニティルームに配置した施設予約、登録できない #1546
Comments
調査2調査したところ、CurrentのフレームIDのセット時にblockとframeのroom_idがずれて、フレームがNULLで帰ってきてました。 https://github.com/NetCommons3/NetCommons/blob/3.3.0.1/Lib/Current/CurrentLibFrame.php#L148 /**
* フレームIDの取得
*
* @return string|null フレームID。nullの場合、パラメータ等からframe_idが取得できなかった
*/
public function getCurrentFrameId() {
$frameId = $this->__getFrameIdInRequest();
if (! $frameId) {
return null;
}
$frame = $this->findFrameById($frameId);
if (! $frame) {
return null;
}
if ($frame['Frame']['block_id'] &&
$this->CurrentLibBlock->isBlockIdInRequest()) {
$blockId = $this->CurrentLibBlock->getCurrentBlockId();
$block = $this->CurrentLibBlock->findBlockById($blockId);
//指定されたブロックとフレームのブロックについて、
//ルームIDとプラグインキーが同じかチェックする
if (! $this->isSameRoomAndPluginByRequestBlockAndFrameBlock($frame, $block)) {
return null; // ←ここでnullになり、Frame.idがCurrentで取れなくなっていた。
}
}
return $frame['Frame']['id'];
} $this->isSameRoomAndPluginByRequestBlockAndFrameBlock($frame, $block)https://github.com/NetCommons3/NetCommons/blob/3.3.0.1/Lib/Current/CurrentLibFrame.php#L410 /**
* リクエストのBlockとFrameのBlockが同じプラグインと同じルームかどうかチェックする。
*
* @param array $frame フレームデータ
* @param array $block ブロックデータ
* @return bool
*/
public function isSameRoomAndPluginByRequestBlockAndFrameBlock($frame, $block) {
if (isset($block['Block']['room_id']) &&
($block['Block']['room_id'] !== $frame['Frame']['room_id'] ||
$block['Block']['plugin_key'] !== $frame['Frame']['plugin_key'])) {
return false;
} else {
return true;
}
}
|
調査3複数のカレンダー、施設予約をパブリックルームとコミュニティルームに配置済み。 実行した SQL: SELECT * FROM `nc3_blocks` WHERE `plugin_key` IN ('calendars','reservations') ORDER BY
`nc3_blocks`.`plugin_key` ASC LIMIT 0, 30 ; 行: 9
報告まで。 |
NC3.3.0で確認しました。
コミュニティルームに配置した施設予約で施設予約すると「申し訳ありませんが、予約の登録・編集は画面に正しく設置された施設予約から行ってください。」となり、登録できなくなりました。
調査
調査したところ、ReservationPlansController::add()のCurrent::read('Frame.id')がNULLになり、上記can_not_editのviewに飛ばされてました。
https://github.com/NetCommons3/Reservations/blob/3.3.0.1/Controller/ReservationPlansController.php#L289-L291
報告まで。
The text was updated successfully, but these errors were encountered: