For a multilanguage-project I have to disable the standard node/add form (and URLs). Therefore, as I did before in another project, I provide these forms in an admin-overlay by a custom module:
<?php
function module_menu() {
$items = array();
// For each node type:
$items['admin/content/[node_type]/add'] = array(
'title' => t('Add @node_type', array('@node_type' => t('Node Type'))),
'page callback' => 'drupal_get_form',
'page arguments' => array('module_node_add_form', 'node_type'),
'access arguments' => array('administer nodes'),
'file path' => drupal_get_path('module', 'node'),
'file' => 'node.pages.inc',
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
return $items;
}
function module_node_add_form ($form, &$form_state, $node_type) {
module_load_include('inc', 'node', 'node.pages');
return node_add($node_type);
}
?>
This worked fine in a non-multilanguage environment. With Entity Translation enabled and field translations in these respective nodes, an error is thrown while form validation:
Fatal error: Call to a member function entityFormValidate() on a non-object in [My Project Path]\sites\all\modules\entity_translation\entity_translation.module on line 1414
I consider this an error caused by Entity Translation and would appreciate any help to avoid it.
Comments
Comment #1
plachWhat about this?
Comment #2
mario steinitzWell, I "applied" this patch manually without effort. The error changed to an 'The website encountered an unexpected error. Please try again later.'-error with the following details:
Comment #3
plachI'm sorry but #2 does not look immediately related to ET. I am happy to commit #1, but for anything else I need steps to reproduce an error in ET or a patch with an explanation of what is causing the issue and how the patch is fixing it (see http://drupal.org/project/entity_translation#bugfixing).
Comment #4
mario steinitzFound a solution for my issue and replaced
with
Now it works like a charm and does not seem to be an Entity Translation bug rather than a bug in the node module or drupal_get_form.
Thanks for your help anyway!
Comment #5
plachThe patch in #1 looks good anyway.
Comment #6
plachCommitted and pushed.