Skip to content
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

cleanup on null panels? #221

Open
onigame opened this issue Sep 22, 2017 · 3 comments

Comments

@onigame
Copy link

commented Sep 22, 2017

Hi. Not sure if this is the right place to report this, but I've installed this and I'm getting errors when trying to clean up:

> php yii audit/cleanup --age=15
PHP Notice 'yii\base\ErrorException' with message 'Trying to get property of non-object'

in /home/whuang/sdc/bapa.rocks/webserver/vendor/bedezign/yii2-audit/src/commands/AuditController.php:67

Stack trace:
#0 /home/whuang/sdc/bapa.rocks/webserver/vendor/bedezign/yii2-audit/src/commands/AuditController.php(67): yii\base\ErrorHandler->handleError(8, 'Trying to get p...', '/home/whuang/sd...', 67, Array)
#1 [internal function]: bedezign\yii2\audit\commands\AuditController->actionCleanup()
#2 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#4 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction('cleanup', Array)
#5 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/Module.php(523): yii\console\Controller->runAction('cleanup', Array)
#6 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('audit/cleanup', Array)
#7 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('audit/cleanup', Array)
#8 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/Application.php(380): yii\console\Application->handleRequest(Object(yii\console\Request))
#9 /home/whuang/sdc/bapa.rocks/webserver/yii(20): yii\base\Application->run()
#10 {main}

> php yii audit/cleanup --age=15 --panels=entries,trails
Total 2 cleanups to be applied:
        DATA                      CLEANUP TO DATETIME
        ---------------------------------------------
Exception 'Error' with message 'Call to a member function getPanel() on null'

in /home/whuang/sdc/bapa.rocks/webserver/vendor/bedezign/yii2-audit/src/commands/AuditController.php:123

Stack trace:
#0 /home/whuang/sdc/bapa.rocks/webserver/vendor/bedezign/yii2-audit/src/commands/AuditController.php(71): bedezign\yii2\audit\commands\AuditController->preCleanupSummary(NULL, NULL, Array, '15')
#1 [internal function]: bedezign\yii2\audit\commands\AuditController->actionCleanup()
#2 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#4 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction('cleanup', Array)
#5 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/Module.php(523): yii\console\Controller->runAction('cleanup', Array)
#6 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('audit/cleanup', Array)
#7 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('audit/cleanup', Array)
#8 /home/whuang/sdc/bapa.rocks/webserver/vendor/yiisoft/yii2/base/Application.php(380): yii\console\Application->handleRequest(Object(yii\console\Request))
#9 /home/whuang/sdc/bapa.rocks/webserver/yii(20): yii\base\Application->run()
#10 {main}


@onigame

This comment has been minimized.

Copy link
Author

commented Jan 25, 2018

I think this was solved by adding the module to the console section of the configuration files (config/console.php). I had added it only to config/web.php.

Not sure it actually works yet.

@Blizzke

This comment has been minimized.

Copy link
Member

commented Jan 25, 2018

I think you're right. Not finding the module seems like the only thing that can cause this error.

Obviously something we should handle with a bit more flair. We can't expect everyone to just have it installed correctly everywhere right away. I'll see when i can make some time to add a test and a proper error message should the module be missing.

Btw: If you need them in both and you are using the advanced application template you can add the module to the common configuration, that should make it more maintainable.

Thanks for reporting this.

@cornernote

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2018

Blizzke added a commit that referenced this issue Feb 4, 2018
Blizzke added a commit that referenced this issue Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.