schmunk42/yii2-giiant

Skip method 'getAttributeHint' is missing in schmunk42\giiant\generators\crud\ModelTrait

iurijacob opened this issue · 2 comments

You should add 'getAttributeHint' method to the $skipMethods array (line 85). Otherwise CLI throws the following exception:

Running 'Giiant CRUD'...

_form.phpException 'ArgumentCountError' with message 'Too few arguments to function yii\db\BaseActiveRecord::getAttributeHint(), 0 passed and exactly 1 expected'

in /project/vendor/yiisoft/yii2/db/BaseActiveRecord.php:1582

Stack trace:
#0 [internal function]: yii\db\BaseActiveRecord->getAttributeHint()
#1 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/ModelTrait.php(98): call_user_func(Array)
#2 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/ModelTrait.php(146): schmunk42\giiant\generators\crud\Generator->getModelRelations('frontend\\module...')
#3 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/providers/core/RelationProvider.php(46): schmunk42\giiant\generators\crud\Generator->getRelationByColumn('frontend\\module...', Object(yii\db\ColumnSchema))
#4 [internal function]: schmunk42\giiant\generators\crud\providers\core\RelationProvider->activeField('nome', Object(frontend\modules\crud\models\Cardapio), Object(schmunk42\giiant\generators\crud\Generator))
#5 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/ProviderTrait.php(253): call_user_func_array(Array, Array)
#6 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/ProviderTrait.php(90): schmunk42\giiant\generators\crud\Generator->callProviderQueue('activeField', Array, Object(frontend\modules\crud\models\Cardapio), Object(schmunk42\giiant\generators\crud\Generator))
#7 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/default/views/_form.php(62): schmunk42\giiant\generators\crud\Generator->activeField('nome', Object(frontend\modules\crud\models\Cardapio))
#8 /project/vendor/yiisoft/yii2/base/View.php(328): require('/project...')
#9 /project/vendor/yiisoft/yii2/base/View.php(250): yii\base\View->renderPhpFile('/Users/iurijaco...', Array)
#10 /project/vendor/yiisoft/yii2-gii/Generator.php(317): yii\base\View->renderFile('/Users/iurijaco...', Array, Object(schmunk42\giiant\generators\crud\Generator))
#11 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/Generator.php(390): yii\gii\Generator->render('views/_form.php', Array)
#12 /project/vendor/schmunk42/yii2-giiant/src/generators/crud/Generator.php(351): schmunk42\giiant\generators\crud\Generator->render('views/_form.php', Array)
#13 /project/vendor/yiisoft/yii2-gii/console/GenerateAction.php(53): schmunk42\giiant\generators\crud\Generator->generate()
#14 /project/vendor/yiisoft/yii2-gii/console/GenerateAction.php(36): yii\gii\console\GenerateAction->generateCode()
#15 [internal function]: yii\gii\console\GenerateAction->run()
#16 /project/vendor/yiisoft/yii2/base/Action.php(94): call_user_func_array(Array, Array)
#17 /project/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\Action->runWithParams(Array)
#18 /project/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction('giiant-crud', Array)
#19 /project/vendor/yiisoft/yii2/base/Module.php(523): yii\console\Controller->runAction('giiant-crud', Array)
#20 /project/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('gii/giiant-crud', Array)
#21 /project/vendor/schmunk42/yii2-giiant/src/commands/BatchController.php(393): yii\console\Application->runAction('gii/giiant-crud', Array)
#22 /project/vendor/schmunk42/yii2-giiant/src/commands/BatchController.php(292): schmunk42\giiant\commands\BatchController->actionCruds()
#23 [internal function]: schmunk42\giiant\commands\BatchController->actionIndex()
#24 /project/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#25 /project/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#26 /project/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction('', Array)
#27 /project/vendor/yiisoft/yii2/base/Module.php(523): yii\console\Controller->runAction('', Array)
#28 /project/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('batch', Array)
#29 /project/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('batch', Array)
#30 /project/vendor/yiisoft/yii2/base/Application.php(380): yii\console\Application->handleRequest(Object(yii\console\Request))
#31 /project/yii(27): yii\base\Application->run()
#32 {main}

Same here. I am using PHP 7.1.2 if that helps

fixed in #195