Preseve mid when reading notice-all document from other module

This commit is contained in:
Kijin Sung 2020-10-02 11:08:03 +09:00
parent fea468f895
commit c9230360cc
2 changed files with 8 additions and 3 deletions

View file

@ -686,10 +686,15 @@ class ModuleHandler extends Handler
if($module_info)
{
// Compare the current mid to the module that the document belongs to.
if(!$this->mid || ($this->mid !== $module_info->mid && $module_info->is_notice !== 'A'))
if(!$this->mid || $this->mid !== $module_info->mid)
{
// If the document is notice-all, preserve the current mid.
if($module_info->is_notice === 'A')
{
return null;
}
// If this is a GET request, redirect to the correct mid.
if(Context::getRequestMethod() === 'GET')
elseif(Context::getRequestMethod() === 'GET')
{
Context::setCacheControl(0);
header('Location: ' . getNotEncodedUrl('', 'mid', $module_info->mid, 'document_srl', $this->document_srl), true, 301);

View file

@ -242,7 +242,7 @@ class boardView extends board
if($oDocument->isExists())
{
// if the module srl is not consistent
if($oDocument->get('module_srl')!=$this->module_info->module_srl )
if($oDocument->get('module_srl') != $this->module_info->module_srl && $oDocument->get('is_notice') !== 'A')
{
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}