Fixed gh-120 that allows export of component with language translations

This commit is contained in:
2017-09-18 02:18:23 +02:00
parent 72c6136bfb
commit 06416e665d
255 changed files with 801 additions and 850 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 39 of this MVC
@build 7th April, 2017
@version @update number 43 of this MVC
@build 16th September, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translation.php
@ -100,6 +100,14 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$item->metadata = $registry->toArray();
}
if (!empty($item->translation))
{
// Convert the translation field to an array.
$translation = new Registry;
$translation->loadString($item->translation);
$item->translation = $translation->toArray();
}
if (!empty($item->components))
{
// JSON Decode components.
@ -814,6 +822,19 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// Set the translation items to data.
if (isset($data['translation']) && is_array($data['translation']))
{
$translation = new JRegistry;
$translation->loadArray($data['translation']);
$data['translation'] = (string) $translation;
}
elseif (!isset($data['translation']))
{
// Set the empty translation to data
$data['translation'] = '';
}
// Set the components string to JSON string.
if (isset($data['components']))
{