noumo / easyii

Easy yii2 cms powered by Yii framework 2
http://easyiicms.com
593 stars 272 forks source link

Undefined index: easyii_gallery_categories_flat #126

Open HankBrown opened 8 years ago

HankBrown commented 8 years ago

New to Yii. This looks good. Fresh install. I'm getting an error for about half of the menu items...

Undefined index: easyii_gallery_categories_flat

  1. in /home/me/sites/cms/start/vendor/noumo/easyii/components/FlatTrait.php at line 42
noumo commented 8 years ago

in /home/me/sites/cms/start/vendor/noumo/easyii/components/FlatTrait.php there is no such file in my project

mikk150 commented 8 years ago

yes, but the problem is there. stumbled on it yesterday too

noumo commented 8 years ago

https://github.com/noumo/easyii/tree/master/components There is no file "FlatTrait.php"

HankBrown commented 8 years ago

Then it must be "the preferred way of installing EasyiiCMS." ? I downloaded the archive zips just now... and you are correct, no FlatTrait.php Composer, git, guthub or Yii... I wouldn't know at this point why the file is included. But it happened to me and mikk150 and it destroys the demo ;) Sorry I do not have the Yii smarts to poke further at this time. Clearly it belonged to the project at one time, it is 104 lines of code starting with namespace yii\easyii\components; use Yii; use yii\easyii\models\SeoText;

Sorry. Wish I could assist further.

ivzakirov commented 8 years ago

I have the same issue. Here is the log: http://pastebin.com/8Kzee4xX Briefly: Installed easyii-start using composer. Got this version of easyii installed: https://github.com/boehsermoe/easyii/commit/ecb674bbefe6ab2015371118706258f8e78f6ac2 Weird, isn't it?

boehsermoe commented 8 years ago

Insert this at top of the Index.php:

error_reporting(E_ALL ^ E_NOTICE);

ivzakirov commented 8 years ago

When I put that "error_reporting(E_ALL ^ E_NOTICE);" at the top of index.php, all errors gone! :smiley: Do you need app error log?

mikk150 commented 8 years ago

I am amazed! It works now. ALL MY ERROR ARE NOW GONE THANK YOU FOR FIXING ALL MY ERRORS!

boehsermoe commented 8 years ago

NO NOT ALL ERRORS! ONLY NOTICE ARE DISABLED!

Nuffic commented 8 years ago

Maybe you should replace it with error_reporting(0) BTW, this is universal fix for every github issue ever :) You're welcome

mikk150 commented 8 years ago

My reaction

noumo commented 8 years ago

It only hides errors. All solved in dev branch.

composer create-project noumo/easyii-shop shop dev-dev
cd shop
composer update
ivzakirov commented 8 years ago

Affirmative. "composer update" solves this issue. However installation guide is still confusing. Perhaps "composer update" command should be there too? Or it stands to reason that this command should be applied after creating project? I think it breaks UX: user precisely follows the guide, but get the problem.

florinp commented 8 years ago

I have the same problem with easyii-start project and i don't know from where the files FlatTrait.php and TreeTrait.php are coming from? CategoryModel class uses this traits. I'm using the dev branch of the easyii.

HankBrown commented 8 years ago

Fixed thank you.

Don't remember what I saw the first time, but thought there was a demo database. After composer update, there is just one page on the front end. Was it empty like that before? We build the entire front end from ground zero? There is still something odd going on here. It does not match what I am reading at Yii, there is no "web" folder... the code is buried in the vendor folder. There's still some bridge to cross to transit from Yii docs to using this project. One module front page demo would help... I will say it is my problem for now....