Release of v5.1.1-beta6

Fix bug in the filter of Languages by linked entities. #1230.
This commit is contained in:
2025-07-01 15:21:42 +00:00
parent cf681b2b16
commit 1702bd1f0c
37 changed files with 870 additions and 818 deletions

View File

@@ -970,7 +970,7 @@ class Admin_viewModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -28,6 +28,7 @@ use VDM\Joomla\Utilities\FormHelper as JCBFormHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Form\Form;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -109,7 +110,7 @@ class Admin_viewsModel extends ListModel
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
* @return Form|boolean The Form object or false on error
*
* @since JCB 2.12.5
*/

View File

@@ -28,6 +28,7 @@ use VDM\Joomla\Componentbuilder\Utilities\FilterHelper as JCBFilterHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Form\Form;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -108,7 +109,7 @@ class Custom_admin_viewsModel extends ListModel
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
* @return Form|boolean The Form object or false on error
*
* @since JCB 2.12.5
*/

View File

@@ -592,7 +592,7 @@ class Custom_codeModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -747,7 +747,7 @@ class Dynamic_getModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -678,7 +678,7 @@ class FieldModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -28,6 +28,7 @@ use VDM\Joomla\Componentbuilder\Utilities\FilterHelper as JCBFilterHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Form\Form;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -111,7 +112,7 @@ class FieldsModel extends ListModel
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
* @return Form|boolean The Form object or false on error
*
* @since JCB 2.12.5
*/

View File

@@ -611,7 +611,7 @@ class FieldtypeModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -477,7 +477,7 @@ class Help_documentModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -904,7 +904,7 @@ class Joomla_componentModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -202,6 +202,30 @@ class Language_translationModel extends AdminModel
$item->metadata = $registry->toArray();
}
if (!empty($item->plugins))
{
// Convert the plugins field to an array.
$plugins = new Registry;
$plugins->loadString($item->plugins);
$item->plugins = $plugins->toArray();
}
if (!empty($item->modules))
{
// Convert the modules field to an array.
$modules = new Registry;
$modules->loadString($item->modules);
$item->modules = $modules->toArray();
}
if (!empty($item->components))
{
// Convert the components field to an array.
$components = new Registry;
$components->loadString($item->components);
$item->components = $components->toArray();
}
if (!empty($item->translation))
{
// Convert the translation field to an array.
@@ -210,24 +234,6 @@ class Language_translationModel extends AdminModel
$item->translation = $translation->toArray();
}
if (!empty($item->plugins))
{
// JSON Decode plugins.
$item->plugins = json_decode($item->plugins);
}
if (!empty($item->modules))
{
// JSON Decode modules.
$item->modules = json_decode($item->modules);
}
if (!empty($item->components))
{
// JSON Decode components.
$item->components = json_decode($item->components);
}
if (empty($item->id))
{
@@ -987,6 +993,45 @@ class Language_translationModel extends AdminModel
$data['metadata'] = (string) $metadata;
}
// Set the plugins items to data.
if (isset($data['plugins']) && is_array($data['plugins']))
{
$plugins = new Registry;
$plugins->loadArray($data['plugins']);
$data['plugins'] = (string) $plugins;
}
elseif (!isset($data['plugins']))
{
// Set the empty plugins to data
$data['plugins'] = '';
}
// Set the modules items to data.
if (isset($data['modules']) && is_array($data['modules']))
{
$modules = new Registry;
$modules->loadArray($data['modules']);
$data['modules'] = (string) $modules;
}
elseif (!isset($data['modules']))
{
// Set the empty modules to data
$data['modules'] = '';
}
// Set the components items to data.
if (isset($data['components']) && is_array($data['components']))
{
$components = new Registry;
$components->loadArray($data['components']);
$data['components'] = (string) $components;
}
elseif (!isset($data['components']))
{
// Set the empty components to data
$data['components'] = '';
}
// Set the translation items to data.
if (isset($data['translation']) && is_array($data['translation']))
{
@@ -1000,24 +1045,6 @@ class Language_translationModel extends AdminModel
$data['translation'] = '';
}
// Set the plugins string to JSON string.
if (isset($data['plugins']))
{
$data['plugins'] = (string) json_encode($data['plugins']);
}
// Set the modules string to JSON string.
if (isset($data['modules']))
{
$data['modules'] = (string) json_encode($data['modules']);
}
// Set the components string to JSON string.
if (isset($data['components']))
{
$data['components'] = (string) json_encode($data['components']);
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))
{

View File

@@ -29,6 +29,7 @@ use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\JsonHelper;
use Joomla\CMS\Form\Form;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -104,7 +105,7 @@ class Language_translationsModel extends ListModel
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
* @return Form|boolean The Form object or false on error
*
* @since JCB 2.12.5
*/
@@ -355,54 +356,50 @@ class Language_translationsModel extends ListModel
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_language_translation', 'a'));
// do not use these filters in the export method
if (!isset($_export) || !$_export)
// Filtering "translated in"
$filter_translated = $this->state->get("filter.translated");
if ($filter_translated !== null && !empty($filter_translated))
{
// Filtering "translated in"
$filter_translated = $this->state->get("filter.translated");
if ($filter_translated !== null && !empty($filter_translated))
if (($ids = JCBFilterHelper::translations($filter_translated)) !== null)
{
if (($ids = JCBFilterHelper::translations($filter_translated)) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
// Filtering "not translated in"
$filter_not_translated = $this->state->get("filter.not_translated");
if ($filter_not_translated !== null && !empty($filter_not_translated))
else
{
if (($ids = JCBFilterHelper::translations($filter_not_translated, false)) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',',$ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
}
// Filtering "extension"
$filter_extension = $this->state->get("filter.extension");
if ($filter_extension !== null && !empty($filter_extension))
// Filtering "not translated in"
$filter_not_translated = $this->state->get("filter.not_translated");
if ($filter_not_translated !== null && !empty($filter_not_translated))
{
if (($ids = JCBFilterHelper::translations($filter_not_translated, false)) !== null)
{
// column name, and id
$type_extension = explode('__', $filter_extension);
if (($ids = JCBFilterHelper::translation((int) $type_extension[1], $type_extension[0])) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
$query->where($db->quoteName('a.id') . ' IN (' . implode(',',$ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
}
// Filtering "extension"
$filter_extension = $this->state->get("filter.extension");
if ($filter_extension !== null && !empty($filter_extension))
{
// column name, and id
$type_extension = explode('__', $filter_extension);
if (($ids = JCBFilterHelper::translation((string) $type_extension[1], (string) $type_extension[0])) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
}
@@ -516,54 +513,50 @@ class Language_translationsModel extends ListModel
$query->where('a.id IN (' . implode(',',$pks) . ')');
}
// do not use these filters in the export method
if (!isset($_export) || !$_export)
{
// Filtering "translated in"
$filter_translated = $this->state->get("filter.translated");
if ($filter_translated !== null && !empty($filter_translated))
$filter_translated = $this->state->get("filter.translated");
if ($filter_translated !== null && !empty($filter_translated))
{
if (($ids = JCBFilterHelper::translations($filter_translated)) !== null)
{
if (($ids = JCBFilterHelper::translations($filter_translated)) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
// Filtering "not translated in"
$filter_not_translated = $this->state->get("filter.not_translated");
if ($filter_not_translated !== null && !empty($filter_not_translated))
else
{
if (($ids = JCBFilterHelper::translations($filter_not_translated, false)) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',',$ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
}
// Filtering "extension"
$filter_extension = $this->state->get("filter.extension");
if ($filter_extension !== null && !empty($filter_extension))
// Filtering "not translated in"
$filter_not_translated = $this->state->get("filter.not_translated");
if ($filter_not_translated !== null && !empty($filter_not_translated))
{
if (($ids = JCBFilterHelper::translations($filter_not_translated, false)) !== null)
{
// column name, and id
$type_extension = explode('__', $filter_extension);
if (($ids = JCBFilterHelper::translation((int) $type_extension[1], $type_extension[0])) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
$query->where($db->quoteName('a.id') . ' IN (' . implode(',',$ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
}
// Filtering "extension"
$filter_extension = $this->state->get("filter.extension");
if ($filter_extension !== null && !empty($filter_extension))
{
// column name, and id
$type_extension = explode('__', $filter_extension);
if (($ids = JCBFilterHelper::translation((string) $type_extension[1], (string) $type_extension[0])) !== null)
{
$query->where($db->quoteName('a.id') . ' IN (' . implode(',', $ids) . ')');
}
else
{
// there is none
$query->where($db->quoteName('a.id') . ' = ' . 0);
}
}
// Implement View Level Access

View File

@@ -615,7 +615,7 @@ class LibraryModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -28,6 +28,7 @@ use VDM\Joomla\Utilities\FormHelper as JCBFormHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Form\Form;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -107,7 +108,7 @@ class PowersModel extends ListModel
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
* @return Form|boolean The Form object or false on error
*
* @since JCB 2.12.5
*/

View File

@@ -534,7 +534,7 @@ class ServerModel extends AdminModel
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param Form $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*

View File

@@ -28,6 +28,7 @@ use VDM\Joomla\Componentbuilder\Utilities\FilterHelper as JCBFilterHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\ObjectHelper;
use VDM\Joomla\Utilities\StringHelper;
use Joomla\CMS\Form\Form;
// No direct access to this file
\defined('_JEXEC') or die;
@@ -109,7 +110,7 @@ class Site_viewsModel extends ListModel
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
* @return Form|boolean The Form object or false on error
*
* @since JCB 2.12.5
*/