jasonhinkle / phreeze

Phreeze Framework for PHP
http://phreeze.com/
GNU Lesser General Public License v2.1
377 stars 207 forks source link

Unknown Property specified. #245

Open rickyherbal opened 8 years ago

rickyherbal commented 8 years ago

First of all I apologize in advance for my bad English, but I need your help.

When I try to sort a column from my app frontend on a field I receive this error:

Unknown Property 'PrjData' specified.

Although he has taken steps to enter this field in the database is in its map file.

How can I fix? thank you.

Esysc commented 8 years ago

Hello, don't worry, mine is even worst. It appears to be a javascript error. What is 'PrjData' ? a json object? Could you explain a little more detailed where you catch the error? In the alarm div of the web page or the developer console?

rickyherbal commented 8 years ago

Thanks for answer me. The list of fields is a report screen. "PrjData" is a "project" table field in my mysql database. The alarm is a red div on web page, on console log compare this message :

"http://********.it/registro/api/reports?page=1&filterByTimeStart=2016-04-01…ilterByProject=&filterByUser=&filterByCategory=&orderDesc=&orderBy=PrjData 401 (Unauthorized)"

Esysc commented 8 years ago

Ok , I understand. Please, give a look to this issue , it appears to be your case #59 . Check your column name are coherent and then go to extend the criteria class. That's something I've done in the past too and I think I had the same problem, but I cannot remember. If I find an example between my criterias, I'll post it.

rickyherbal commented 8 years ago

Sorry, I follow the examples (i download the zip folder) but doesn't work. The only thing that partially resolve the problem is to insert the new field in the "TimeEntryMap.php" file.

`class TimeEntryMap implements IDaoMap { /* * Returns a singleton array of FieldMaps for the TimeEntry object * @access public * @return array of FieldMaps */ public static function GetFieldMaps() { static $fm = null; if ($fm == null) { $fm = Array(); $fm["PrjData"] = new FieldMap("PrjData","projects","prjdata",false,FM_TYPE_TIMESTAMP,null,null,false); $fm["Amount"] = new FieldMap("Amount","projects","amount",false,FM_TYPE_INT,11,null,false); $fm["Id"] = new FieldMap("Id","time_entries","id",true,FM_TYPE_INT,10,null,true); $fm["ProjectId"] = new FieldMap("ProjectId","time_entries","project_id",false,FM_TYPE_INT,10,null,false); $fm["UserId"] = new FieldMap("UserId","time_entries","user_id",false,FM_TYPE_INT,10,null,false); $fm["CategoryId"] = new FieldMap("CategoryId","time_entries","category_id",false,FM_TYPE_INT,10,null,false); $fm["Start"] = new FieldMap("Start","time_entries","start",false,FM_TYPE_TIMESTAMP,null,null,false); $fm["End"] = new FieldMap("End","time_entries","end",false,FM_TYPE_TIMESTAMP,null,null,false); $fm["Description"] = new FieldMap("Description","time_entries","description",false,FM_TYPE_TEXT,null,null,false); $fm["Location"] = new FieldMap("Location","time_entries","location",false,FM_TYPE_VARCHAR,50,null,false); } return $fm; }

However, this causes other errors during insertion of data in the tables. `

Esysc commented 8 years ago

If you added the field after the builder run, you need to run the builder again, only for that table. Then update the template, views, and controllers. You said "insert the new file", so I guess you modified your table afterwards.