I am not sure if it is the designed behavior of this module but field population doesn't work when groups audience is not a required field. I wanted the Forum content type to be available in my site's OG content type. But I don't want necessarily to relate each Forum post to one of my groups. So the logical choice was making 'groups audience' (og_group_ref) optional, not a required field. This setup works as expected but when I began to use this module I noticed that it works (populates) for my Group Post where og_group_ref is required but not works for Forum posts. When I make the field required in Forum content type it begins to work. I can work on a patch but I don't know which module function will be relevant.

My setup is as follows:
og 7.x-2.0
entityreference 7.x-1.0
entityreference_prepopulate 7.x-1.2

Field behavior settings:
Action : Do Nothing
Fallback : Do Nothing
Skip access permission : None
OG context : checked (unchecked doesn't work neither)

Comments

pembeci’s picture

Is anybody else experiencing this problem? Can someone test this and leave feedback here? If I know that the problem stems from my configuration but not from the module, then I can try to track what the problem is on my side. Thanks.

bburg’s picture

Issue summary: View changes

I noticed this today myself. I believe this is because the taxonomy_forums is a term reference field, and this module only seems to work on node references. Although by the name, it would make me think it worked on either...

Anyway, the Prepopulate module does handle term references, you just need to create your query parameter carefully. This worked for me:


$query['edit[taxonomy_forums][und]'] = $forum[0]['tid'];
$url = url('node/add/forum');
drupal_goto($url,  array('query' => $query, 'alias' => TRUE));

bburg’s picture

Status: Active » Closed (won't fix)

Since this functionality is available elsewhere, I'm closing this issue.

pembeci’s picture

Thanks for the response and the hint bburg. I don't mind you closing the issue after 2.5 years passed but as you said the module says "Provides a field type that can reference arbitrary entities" and AFAIK terms are also entities. So this should be considered still a minor bug but since nobody else is experiencing this let it rest in peace. No need to spend time on fixing it.