I have just recently update everything for my project and for some reason I am no longer able to have my queries return the full query itself. What I am seeing is just the primary key and no other columns. I am using NetBeans and have traced through everything and see that it goes through each of the columns when it building the data but then returns null. My colums names are as such “crdInfo”, because of an other update via MySQL I had to put ‘attributes’ => [PDO::ATTR_CASE => PDO::CASE_LOWER] into my db.conf so I would stop getting the:
PHP Notice – yii\base\ErrorException
Undefined index: constraint_name
I put that in and was able to once again use GII to setup my CRUD, but now even all the older Model’s I have are just returning the Primary ID like I stated above. Not sure if there is a bug tracker for this because I didn’t see it, or if anyone else is having this issue. My version of Yii2 is 2.0.36, mysql Ver 8.0.21-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu)).
For the query I am using the basic > $model = UsrFav::findAll(['usrID'=>(Yii::$app->user->isGuest)?"0":Yii::$app->user->identity->id]);
I have tried rolling back to 2.0.35 but I still get the same issue. I have not been able to get to 2.0.37@dev it keeps saying that there is nothing available for that. I do have DEV as part of my composer options.
My production server has not had its MySQL updated so it still work, but my newer development system is updated to the latest MySQL of 8, and I have a feeling this is the issue. Any other suggestions besides downgrading MySQL?
Sorry been crazy with other things and now I have been able to come back to this issue. I am still having the same thing with every new setup I have down for my organization. It is defiantly something with the newest version of MySQL and the Yii connector for it. I have test newer projects with this setup and I have no issues, but this older project I still am. I have a feeling it has something to do with the column names of the database, specifically with names that are non-alphanumeric.
CREATE TABLE crdData ( id int NOT NULL, crdLayout varchar(20) NOT NULL DEFAULT ‘Card’, crdMultiverse int DEFAULT NULL, oracle_id varchar(50) DEFAULT NULL, uri text, scryfall_uri text, sfID varchar(50) DEFAULT NULL, crdName varchar(255) NOT NULL, crdMultiID int DEFAULT NULL, crdMultiName varchar(255) DEFAULT NULL, crdURI_small varchar(255) NOT NULL, crdURI_normal varchar(255) NOT NULL, crdURI_large varchar(255) NOT NULL, crdURI_png varchar(255) NOT NULL, crdURI_art varchar(255) NOT NULL, crdURI_border varchar(255) NOT NULL, crdFileGUID varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
This is the structure of one of the tables having issue with nothing returning. I have a feeling it has something to do with the columns that have the _ (underscore) in them. My newer table do not have anything like that and they seem to work fine with all the new stuff. I have a few other older projects that have similar situations with the naming convention for columns and it would be a bear to have to rename all them without the underscore.
As for putting this to github I have no issue with that just would like to know where about you would like me to move this to. Thanks for everything you guys are doing.
It’s still a bit too vague for a proper bug report. It can be something in the project or, indeed, something in the Yii DB connection/schema.
How about taking same versions of Yii and the database, getting basic application template and setting a minimal test case. A table with such names, some data. If you’ll be able to reproduce it - it will be a good test case proving there’s a bug. If not, that’s something in the application itself.