Doctrine record unknown exception in a Symfony 1.4 backend admin module

☆樱花仙子☆ 提交于 2019-12-12 02:32:06

问题


I am facing a problem with the admin generator and I am unable to get my way around this after 3 hours of brainstorming and exploring.

The error reads as:

500 | Internal Server Error | Doctrine_Record_UnknownPropertyException Unknown record property / related component "option1" on "Questions"

Looking up the WWW, I got a gist of possible alternatives. None of which seem like the answer. option1, does exist under Questions schema. However, it is option_1 so I am not sure why it says option1. More importantly, opening up BaseQuestions.class.php file, it clearly states:

getOption1() retrieves the value of option_1.

Anybody with any answer on this?

Thanks,


回答1:


I had just the same problem with a field named address_2. Changing the name of the field in the database to address2 solved the problem. I think that that this is because of the number that confuse the admin generator to translate the name from underscore-separated propriety name to camelCase function name. This issue append only with the admin generator so, if you need to use it you have to change the field name in your DB with option1.



来源:https://stackoverflow.com/questions/9371212/doctrine-record-unknown-exception-in-a-symfony-1-4-backend-admin-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!