Skip to content

Commit

Permalink
Merge pull request techjoomla#222 from ankush-maherwal/release-1.4.4
Browse files Browse the repository at this point in the history
Bug #152905 fix: Front end>> Radio button under UCM sub form is not w…
  • Loading branch information
ankush-maherwal authored Nov 28, 2019
2 parents e514e67 + 820593b commit 7322ef6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions site/helpers/tjfields.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ private function saveSingleValuedFieldData($fieldValue, $client, $contentId, $fi
}

JLoader::import('components.com_tjfields.tables.fieldsvalue', JPATH_ADMINISTRATOR);
JLoader::import('components.com_tjfields.tables.option', JPATH_ADMINISTRATOR);
$fieldsValueTable = JTable::getInstance('FieldsValue', 'TjfieldsTable', array('dbo', JFactory::getDbo()));
$fieldOptionTable = JTable::getInstance('Option', 'TjfieldsTable', array('dbo', JFactory::getDbo()));

// Set currently logged in users id as user_id
$fieldsValueTable->user_id = JFactory::getUser()->id;
Expand All @@ -497,6 +499,12 @@ private function saveSingleValuedFieldData($fieldValue, $client, $contentId, $fi
if ($fieldValue != '')
{
$fieldsValueTable->value = $fieldValue;
$fieldOptionTable->load(array('field_id' => $fieldId, 'value' => $fieldValue));

if ($fieldOptionTable->id)
{
$fieldsValueTable->option_id = $fieldOptionTable->id;
}

if ($fieldsValueTable->store())
{
Expand All @@ -519,6 +527,13 @@ private function saveSingleValuedFieldData($fieldValue, $client, $contentId, $fi
$fieldsValueTable->value = $fieldValue;
$fieldsValueTable->client = $client;

$fieldOptionTable->load(array('field_id' => $fieldId, 'value' => $fieldValue));

if ($fieldOptionTable->id)
{
$fieldsValueTable->option_id = $fieldOptionTable->id;
}

if ($fieldsValueTable->store())
{
return true;
Expand Down

0 comments on commit 7322ef6

Please sign in to comment.