kartik-v / yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0
http://demos.krajee.com/markdown
Other
89 stars 41 forks source link

using as sub-module: preview caused "property of non-object' caused by $module->customConversion #45

Closed MetaCrawler closed 5 years ago

MetaCrawler commented 9 years ago

Hi,

When I use the editor as sub-modue inside a module/extension with own configuration and executing the preview I reicve:

PHP Notice 'yii\base\ErrorException' with message 'Trying to get property of non-object' 
in D:\basic_project\vendor\kartik-v\yii2-markdown\controllers\ParseController.php:31

All other functions (for example the downloads) are working like expected. When I use the configuration in app/config/web.php instead of the extension config - the preview works without any problems.

My extension / module is configured like described in the yii2 guide: http://www.yiiframework.com/doc-2.0/guide-structure-modules.html

My Module.php looks like this:

namespace app\modules\test;

class Module extends \yii\base\Module
{
    public function init()
    {
        parent::init();

        $this->modules = [
            'markdown' => [
                'class' => 'kartik\markdown\Module',
                'previewAction' => 'markdown/parse/preview',
                'downloadAction' => 'markdown/parse/download',
            ],
        ];
    }
}

Is this a bug or did I something wrong with the configuration as sub-module?

Thank you and best regards

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.