0

I created a module with a .info, .module and .install file that can be installed by customers. This module file to create content types from node consists basically atm of:

/**
* Implements hook_node_info()
*/
function mycontent_node_info() {
  return array(
    'mycontent' => array(
        'name' => t('My content'),
        'base' => 'mycontent',
        'description' => t('You can define your objects here'),
        'has_title' => TRUE,
        'title_label' => t('Object title')
       )
    );
}

/**
* Implement hook_form()
*/
function mycontent_form($node, $form_state) {
   return node_content_form($node, $form_state);
}

The problem is as follows:

I want to use entity translation. This works fine but the title module. It ist automatically installed, so the standard title of nodes can be replaced by clicking 'replace', but the default language is not filled.

E.g. if default language is German, the title is not saved. When I translate in English, the English title is saved. When I debug I can see that the complete (German or English) form is taken, the value of the form state are identical except the content itself and the language values 'de' and 'en'.

If I change en as default language then english title is not saved.

Because i can not see anything in the issue tracker of the title module I hope that I have to add anything to my code.

Thx in advance

maen

0

Ok, I BELIEVE that this is a drupal core issue:

I thought I can create a module with another name as the node bundle I made.

/**
* Implements hook_node_info()
*/
function mycontent_node_info() {
  return array(
    'mycontent' => array(
      'name' => t('My content'),
      'base' => 'mycontent',
      'description' => t('You can define your objects here'),
      'has_title' => TRUE,
      'title_label' => t('Object title')
     )
  );
 }

 /**
  * Implement hook_form()
 */
   function mycontent_form($node, $form_state) {
     return node_content_form($node, $form_state);
   }

This is correct! But my module and hence my hook_node_info function had another name than my bundle.

So admin/strucure/types didn't show the bundle and the module title didn't recognize the bundle property.

So this is solved!

| improve this answer | |

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.