rainlab / pages-plugin

Adds static pages and menus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is a bug in the maintenance mode.

ZhiweiWu0425 opened this issue · comments

在维护模式下有bug,开启维护模式,页面并不正常显示维护页面,会吧当前url的static-pages信息也显示出来

There is a bug in the maintenance mode. When the maintenance mode is turned on, the page does not display the maintenance page normally, so the static-pages information of the current url is also displayed

image
dd

commented

Hi @ZhiweiWu0425

We can confirm that the maintenance mode is working with pages generated using this pages plugin. Note, if you are signed in as an administrator, then maintenance mode will not have any effect. Administrators can navigate the website when maintenance mode is turned on.

If this is still an issue, please provide step-by-step replication instructions on how to arrive at the problem.

I hope this helps.

I understand what you said
But if the maintenance mode is enabled, ExtraData should not be added to the interface, and the maintenance interface should only display Pages/xx.htm set by the maintenance mode
I tried to add some code in RainLab\Pages\Components\StaticPage, which achieved the effect I said
I wonder if you understand what I mean

/**
     * Find foreign view bag values and add them to
     * the component and page vars.
     */
    protected function defineExtraData()
    {

        /*
         * Maintenance mode
         */
        if (
            MaintenanceSetting::isConfigured() &&
            MaintenanceSetting::get('is_enabled', false) &&
            !BackendAuth::getUser()
        ) {
            /*
             * If the maintenance mode is enabled, ExtraData should not be added to the interface, 
             * and the maintenance interface should only display Pages/xx.htm
             */
            return true;
        }

        ....

        return $extraData;
    }

original
您说的我都明白
但是如果开启维护模式,不应吧ExtraData添加到界面,维护界面只应显示 维护模式设置的Pages/xx.htm
我在RainLab\Pages\Components\StaticPage中尝试加入了一些代码,达到我说的效果了
不知您是否理解我表达的意思

commented

@ZhiweiWu0425

Got it! Fix can be found here 41474b7

Thanks

Thank you for handling this issue quickly, everything is normal now, great! !