security update core+modules
This commit is contained in:
@@ -12,7 +12,14 @@ include_once DRUPAL_ROOT . '/includes/locale.inc';
|
||||
include_once drupal_get_path('module', 'locale') . '/locale.admin.inc';
|
||||
|
||||
/**
|
||||
* Generate translate page from object
|
||||
* Generate translate page from object.
|
||||
*
|
||||
* @param string $object_type
|
||||
* Obejct type as declared in hook_i18n_object_info().
|
||||
* @param object $object_value
|
||||
* Drupal object to translate.
|
||||
* @param object $language
|
||||
* Optional language object.
|
||||
*/
|
||||
function i18n_string_translate_page_object($object_type, $object_value, $language = NULL) {
|
||||
// For backwards compatibility, ensure parameter is a language object
|
||||
@@ -22,6 +29,13 @@ function i18n_string_translate_page_object($object_type, $object_value, $languag
|
||||
$object = i18n_object($object_type, $object_value);
|
||||
$strings = $object->get_strings(array('empty' => TRUE));
|
||||
|
||||
// If no localizable strings, print message and fail gracefully.
|
||||
// Possibly this object comes from some other contrib module.
|
||||
// See http://drupal.org/node/1889878
|
||||
if (!$strings) {
|
||||
return t('This object has no strings available for translation.');
|
||||
}
|
||||
|
||||
if (empty($langcode)) {
|
||||
drupal_set_title(t('Translate !name', array('!name' => i18n_object_info($object_type, 'title'))));
|
||||
return i18n_string_translate_page_overview($object, $strings);
|
||||
@@ -44,7 +58,6 @@ function i18n_string_translate_page_overview($object, $strings) {
|
||||
* Provide a core translation module like overview page for this object.
|
||||
*/
|
||||
function i18n_string_translate_page_overview_form($form, &$form_state, $object, $strings) {
|
||||
//include_once DRUPAL_ROOT . '/includes/language.inc';
|
||||
// Set the default item key, assume it's the first.
|
||||
$item_title = reset($strings);
|
||||
$header = array(
|
||||
@@ -385,6 +398,9 @@ function i18n_string_locale_translate_edit_form_submit($form, &$form_state) {
|
||||
// Invoke locale submission.
|
||||
locale_translate_edit_form_submit($form, $form_state);
|
||||
$lid = $form_state['values']['lid'];
|
||||
if ($i18n_string_object = i18n_string_get_by_lid($lid)) {
|
||||
$i18n_string_object->cache_reset();
|
||||
}
|
||||
foreach ($form_state['values']['translations'] as $key => $value) {
|
||||
if (!empty($value)) {
|
||||
// An update has been made, so we assume the translation is now current.
|
||||
|
||||
Reference in New Issue
Block a user