#156429 by GreenMother: kill notices if form ID does not exist
parent
7aa0b54b78
commit
b5cdf535f4
|
@ -255,7 +255,7 @@ function locale_form_alter(&$form, $form_state, $form_id) {
|
|||
|
||||
// Language field for nodes
|
||||
default:
|
||||
if ($form['#id'] == 'node-form') {
|
||||
if (isset($form['#id']) && $form['#id'] == 'node-form') {
|
||||
if (isset($form['#node']->type) && variable_get('language_' . $form['#node']->type, 0)) {
|
||||
$form['language'] = array(
|
||||
'#type' => 'select',
|
||||
|
|
|
@ -92,7 +92,7 @@ function translation_form_alter(&$form, $form_state, $form_id) {
|
|||
// Description based on text from locale.module.
|
||||
$form['workflow']['language']['#description'] = t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the <a href="!languages">enabled languages</a>. You can also turn on translation for this content type, which lets you have content translated to any of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/settings/language')));
|
||||
}
|
||||
elseif ($form['#id'] == 'node-form' && translation_supported_type($form['#node']->type)) {
|
||||
elseif (isset($form['#id']) && $form['#id'] == 'node-form' && translation_supported_type($form['#node']->type)) {
|
||||
$node = $form['#node'];
|
||||
if (!empty($node->translation_source)) {
|
||||
// We are creating a translation. Add values and lock language field.
|
||||
|
|
Loading…
Reference in New Issue