Commit b5cdf535 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#156429 by GreenMother: kill notices if form ID does not exist

parent 7aa0b54b
......@@ -255,7 +255,7 @@ function locale_form_alter(&$form, $form_state, $form_id) {
// Language field for nodes
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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment