在Symfony 1.4后端管理模块中,Doctrine记录未知异常 [英] Doctrine record unknown exception in a Symfony 1.4 backend admin module

查看:217
本文介绍了在Symfony 1.4后端管理模块中,Doctrine记录未知异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在面对管理员发生器的问题,我经过3个小时的头脑风暴和探索后,无法摆脱这个问题。



错误读为:



500 |内部服务器错误| Doctrine_Record_UnknownPropertyException
问题上的未知记录属性/相关组件option1



查看WWW,我得到了一些可能的选择。没有一个看起来像答案。 option1,存在于问题模式下。但是,它是option_1,所以我不知道为什么它选项1。更重要的是,打开BaseQuestions.class.php文件,它清楚地表明:



getOption1()检索option_1的值。



任何人有任何答案?



谢谢,

解决方案>

我与名为 address_2 的字段也有同样的问题。将数据库中的字段名称更改为 address2 可以解决问题。我认为这是因为这个数字混淆了管理生成器将名称从下划线分隔的适当名称翻译成camelCase函数名称。此问题仅与管理生成器附加,因此,如果您需要使用它,您必须使用 option1 更改数据库中的字段名称。


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,

解决方案

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.

这篇关于在Symfony 1.4后端管理模块中,Doctrine记录未知异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆