When I post a new question, drupal shows a messages as below:

Notice: Undefined property: stdClass::$field_answer_count at locale_field_entity_form_submit() (line 443 at /opt/test/modules/locale/locale.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chipcleary’s picture

Which version of core are you using?

The background: According to #1062072: Notice : Undefined property: stdClass::$field_name_of_the_field in locale_field_node_form_submit(), this is an issue in core. The issue is in progress here #822418: Field form structure incomplete if field_access() returns FALSE. You should be able to eliminate it by using these directions:

http://drupal.org/node/1062072#comment-5043284

That said, this was old news. The issue trail indicates that the problem in core was apparently fixed in Drupal 7.15 back in Aug 2012. If you are using the current version of core, it looks like it should have been resolved.

garamani’s picture

Thanks chipcleary,
I'm using the 7.22 version of drupal so the reason of Error is probably not related to the core issues.

@alevelweb
have you resolved the problem?

chipcleary’s picture

Status: Active » Needs review
FileSize
1.03 KB

It turns out that the patch to locale indicated above will fix the issue.

However, it is not clear to me whether that patch really is for a bug in core or a work-around for another problem. The underlying issue is that $field_answer_count (a node reference count field) was not getting an initial value set and locale expects one.

I've patched answers with a work-around that eliminates the problem.

garamani’s picture

Thanks,
The error disappeared but now a warning message appear:

AUP: Could not find Answers Reputation userpoints category

Is this warning serious? or ignorable?

chipcleary’s picture

Hi @garamani, could you tell me what version of AUP you are using? I will see if I can duplicate this.

garamani’s picture

Hi chipcleary
AUP version is: 7.x-1.1+1-dev
Answers version is: 7.x-3.0+21-dev

chipcleary’s picture

OK, thanks. I did duplicate this. It turns out to be a known issue. The resolution and explanation are here:

https://drupal.org/node/1792166#comment-6567496

The fix is already included in AUP 7.x-1.x-dev. (Please note that you must use the dev version when following the instructions in the comment).

That said, it's bad that the 7.x-1.1 version has a show-stopper bug in it. I will release a new version that has the fix incorporated.

garamani’s picture

Thanks for quick answers and quick fixes, keep it up
Yes, The solution you mentioned in that comment resolved the problem in the blink of an eye!

for those who wanna know how:
1.install devel module
2.go here: structure>blocks and enable "development" block
3.click on "Reinstall modules"
4. tick "aup" check box and click on "reinstall" button

Thanks again

chipcleary’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.