From a181adb25ea818e029fc6d00e5cb0a666047a343 Mon Sep 17 00:00:00 2001 From: Andrei - Marius Dincu Date: Fri, 4 Jul 2014 00:35:30 +0300 Subject: [PATCH] Issue #2249723 by andrei.dincu: Add Undefined language in xmlsitemap_form_xmlsitemap_sitemap_edit_form_alter() --- xmlsitemap.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmlsitemap.module b/xmlsitemap.module index 431891d9..f3c79e1b 100644 --- a/xmlsitemap.module +++ b/xmlsitemap.module @@ -440,16 +440,15 @@ function xmlsitemap_sitemap_load_by_context(array $context = NULL) { * @todo Save the sitemap's URL as a column? */ function xmlsitemap_sitemap_save(XmlSitemapInterface $sitemap) { - $context = $sitemap->getContext(); + $context = $sitemap->context; if (!isset($context) || !$context) { - $sitemap->setContext(array()); + $sitemap->context = array(); } // Make sure context is sorted before saving the hash. //$sitemap->is_new = empty($sitemap->getId()); //$sitemap->old_smid = $sitemap->is_new ? NULL : $sitemap->smid; $sitemap->setOriginalId($sitemap->isNew() ? NULL : $sitemap->getId()); - $context = $sitemap->getContext(); $sitemap->setId(xmlsitemap_sitemap_get_context_hash($context)); // If the context was changed, we need to perform additional actions. if (!$sitemap->isNew() && $sitemap->getId() != $sitemap->getOriginalId()) { @@ -2078,6 +2077,7 @@ function xmlsitemap_form_xmlsitemap_sitemap_edit_form_alter(&$form, $form_state) foreach ($languages as $language_key => $language) { $options[$language_key] = $language->getName(); } + $options[LanguageInterface::LANGCODE_NOT_SPECIFIED] = t('Undefined language'); $form['context']['language'] = array( '#type' => 'select', -- GitLab