We are using Commons modules and among other parts of it a Q&A module. We noticed that when a user question is answered ,, answers do not get published. Not even when admin answers the question. Instead, we have to go in and set publishing options for all answers, one at a time.

The content type used for answers is called "Answers" and a default setting for publishing options is set to "published".

When the answer form is submitted the publishing option is not checked..

Does anyone know why this is getting overridden and how to make this work?



Recently I had a slightly different but similar issue with answers in commons. When a user answers a question it was by default visible to trusted contacts of that user but not visible to group members and there was no way to change that even as an admin. After spending quite some time, I tried disabling the commons feature "Commons Trusted Contacts" which solved the problem.

So, one thing is clear it is this feature/module which is overriding. If you don't need trusted contacts functionality, you can just disable this. Otherwise, Commons trusted contacts is the right place to look into to solve the actual cause.


I think the answer you want is the patch in this issue: https://www.drupal.org/node/2399695

  • This looks like a link-only answer. Please explain what this link is about, and how it answers the question ... – Pierre.Vriens Feb 19 '17 at 10:02

You could look to see if there is a custom module implementing hook_from_alter or hook_form_FORM_ID_alter and overriding the default behavior. Search the code base for _form_alter in custom module directory to get started. If you could not find the what is actually overriding the default behaviors then you could implement hook_form_alter or hook_form_FORM_ID_alter and override the behavior yourself. Do something along these lines:

<yourmodule>_form_node_form_alter(&$form, $form_state) {
   // Do some checks to verify this is the content type you are targeting.
  $form['options']['status']['#default_value'] = TRUE;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.