GreenMeteor / discordapp

Discord Module for Humhub
https://www.humhub.org/en/marketplace/details?id=31
11 stars 5 forks source link

Dashboard error #11

Closed Buliwyfa closed 7 years ago

Buliwyfa commented 7 years ago

What steps will reproduce the problem?

Install de module Enable go to dashboard

What is the expected result?

see the dashboard

What do you get instead?

This error PHP Notice – yii\base\ErrorException Undefined variable: options

1. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\modules\discordapp\widgets\views\discordappframe.php at line 16
7891011121314151617181920

\humhub\modules\discordapp\Assets::register($this);
?>

<div class="panel">
  <div class="panel-heading">
    <?=Yii::t('DiscordappModule.base', '<strong>Discord</strong> Chat'); ?>
  </div>
  <div class="panel-body">

<?= Html::beginTag('div', $options) ?>
<iframe src="<?= $discordappUrl; ?>" id="discordAPPFrame" width="100%" height="500" allowtransparency="true" frameborder="0" name="iframeContainer"></iframe>
<?= Html::endTag('div'); ?>
</div>
</div>

2. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\modules\discordapp\widgets\views\discordappframe.php at line 16 – yii\base\ErrorHandler::handleError(8, 'Undefined variable: options', 'C:\_webs_\humhub.1.2.2.test.desa...', 16, ...)
1011121314151617181920

<div class="panel">
  <div class="panel-heading">
    <?=Yii::t('DiscordappModule.base', '<strong>Discord</strong> Chat'); ?>
  </div>
  <div class="panel-body">

<?= Html::beginTag('div', $options) ?>
<iframe src="<?= $discordappUrl; ?>" id="discordAPPFrame" width="100%" height="500" allowtransparency="true" frameborder="0" name="iframeContainer"></iframe>
<?= Html::endTag('div'); ?>
</div>
</div>

3. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\View.php at line 330 – require('C:\_webs_\humhub.1.2.2.test.desa...')
4. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\View.php at line 250 – yii\base\View::renderPhpFile('C:\_webs_\humhub.1.2.2.test.desa...', ['discordappUrl' => 'https://discordapp.com/widget?id...'])
5. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\View.php at line 152 – yii\base\View::renderFile('C:\_webs_\humhub.1.2.2.test.desa...', ['discordappUrl' => 'https://discordapp.com/widget?id...'], humhub\modules\discordapp\widgets\DiscordappFrame)
6. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\Widget.php at line 234 – yii\base\View::render('discordappframe', ['discordappUrl' => 'https://discordapp.com/widget?id...'], humhub\modules\discordapp\widgets\DiscordappFrame)
7. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\modules\discordapp\widgets\DiscordappFrame.php at line 25 – yii\base\Widget::render('discordappframe', ['discordappUrl' => 'https://discordapp.com/widget?id...'])
19202122232425262728

     * @inheritdoc
     */
   public function run()
    {
        $url = Yii::$app->getModule('discordapp')->getServerUrl() . '/widget?id=';
        return $this->render('discordappframe', [
                    'discordappUrl' => $url
        ]);
    }
}

8. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\humhub\components\Widget.php at line 58 – humhub\modules\discordapp\widgets\DiscordappFrame::run()
52535455565758596061626364

        ob_implicit_flush(false);
        try {
            /* @var $widget Widget */
            $widget = Yii::createObject($config);
            $out = '';
            if ($widget->beforeRun()) {
                $result = $widget->run();
                $out = $widget->afterRun($result);
            }
        } catch (\Exception $e) {
            // close the output buffer opened above if it has not been closed already
            if (ob_get_level() > 0) {
                ob_end_clean();

9. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\humhub\widgets\BaseStack.php at line 85 – humhub\components\Widget::widget(['class' => 'humhub\modules\discordapp\widget...'])
79808182838485868788899091

        $i = 0;
        foreach ($this->getWidgets() as $widget) {
            $i++;

            $widgetClass = $widget[0];

            $out = $widgetClass::widget($widget[1]);

            if (!empty($out)) {
                $content .= $out;
                if ($i != count($this->getWidgets())) {
                    $content .= $this->seperator;
                }

10. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\Widget.php at line 139 – humhub\widgets\BaseStack::run()
11. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\humhub\modules\dashboard\views\dashboard\index.php at line 20 – yii\base\Widget::widget(['widgets' => [['humhub\modules\activity\widgets\...', ['streamAction' => '/dashboard/dashboard/stream'], ['sortOrder' => 150]]], 'class' => 'humhub\modules\dashboard\widgets...'])
14151617181920212223242526

                'showProfilePostForm' => $showProfilePostForm
            ])?>
        </div>
        <div class="col-md-4 layout-sidebar-container">
            <?php
            echo \humhub\modules\dashboard\widgets\Sidebar::widget([
                'widgets' => [
                    [
                        \humhub\modules\activity\widgets\Stream::className(),
                        ['streamAction' => '/dashboard/dashboard/stream'],
                        ['sortOrder' => 150]
                    ]
                ]

12. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\View.php at line 330 – require('C:\_webs_\humhub.1.2.2.test.desa...')
13. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\View.php at line 250 – yii\base\View::renderPhpFile('C:\_webs_\humhub.1.2.2.test.desa...', ['showProfilePostForm' => '1', 'contentContainer' => humhub\modules\user\models\User])
14. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\View.php at line 152 – yii\base\View::renderFile('C:\_webs_\humhub.1.2.2.test.desa...', ['showProfilePostForm' => '1', 'contentContainer' => humhub\modules\user\models\User], humhub\modules\dashboard\controllers\DashboardController)
15. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\Controller.php at line 381 – yii\base\View::render('index', ['showProfilePostForm' => '1', 'contentContainer' => humhub\modules\user\models\User], humhub\modules\dashboard\controllers\DashboardController)
16. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\humhub\modules\dashboard\controllers\DashboardController.php at line 62 – yii\base\Controller::render('index', ['showProfilePostForm' => '1', 'contentContainer' => humhub\modules\user\models\User])
565758596061626364656667

    {
        if (Yii::$app->user->isGuest) {
            return $this->render('index_guest', []);
        } else {
            return $this->render('index', [
                'showProfilePostForm' => Yii::$app->getModule('dashboard')->settings->get('showProfilePostForm'),
                'contentContainer' => Yii::$app->user->getIdentity()
            ]);
        }
    }

}

17. humhub\modules\dashboard\controllers\DashboardController::actionIndex()
18. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([humhub\modules\dashboard\controllers\DashboardController, 'actionIndex'], [])
19. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\Controller.php at line 156 – yii\base\InlineAction::runWithParams([])
20. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\Module.php at line 523 – yii\base\Controller::runAction('', [])
21. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\web\Application.php at line 102 – yii\base\Module::runAction('dashboard/dashboard', [])
22. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\vendor\yiisoft\yii2\base\Application.php at line 380 – yii\web\Application::handleRequest(humhub\components\Request)
23. in C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\index.php at line 19 – yii\base\Application::run()
13141516171819

    require(__DIR__ . '/protected/humhub/config/web.php'),
    (is_readable(__DIR__ . '/protected/config/dynamic.php')) ? require(__DIR__ . '/protected/config/dynamic.php') : [],
    require(__DIR__ . '/protected/config/common.php'),
    require(__DIR__ . '/protected/config/web.php')
);

(new humhub\components\Application($config))->run();

Additional info

Q A
HumHub version 1.?
PHP version
Operating system

Note: Also provide the full error stacks from ACP --> Information --> Logging and errors from your browser console.

Felli commented 7 years ago

Please try removing , $options from

C:\_webs_\humhub.1.2.2.test.desarrollo.online\public\protected\modules\discordapp\widgets\views\discordappframe.php at line 16

Felli commented 7 years ago

I've confirmed that the module no longer shows any errors within the dashboard if it still does for you please request for this to be reopened and I'll work to fix it as soon as possible.