Skip to content

Commit

Permalink
Task techjoomla#288 fix: UCM item ownership goes to selected user if …
Browse files Browse the repository at this point in the history
…Set as UCM Type Item Creator NO in ownership type field
  • Loading branch information
pravinTek committed Dec 10, 2019
1 parent 67f570c commit 0f22e58
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/com_tjucm/site/models/itemform.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,16 @@ public function saveFieldsData($fieldData)

if (!empty($fieldData['fieldsvalue'][$ownerShipFieldName]))
{
$ucmItemTable->created_by = $fieldData['fieldsvalue'][$ownerShipFieldName];
JLoader::import('components.com_tjfields.tables.field', JPATH_ADMINISTRATOR);
$fieldTable = JTable::getInstance('Field', 'TjfieldsTable', array('dbo', JFactory::getDbo()));
$fieldTable->load(array('name' => $ownerShipFieldName));
$fieldParams = new Registry($fieldTable->params);

// If enabled then the selected user will be set as creator of the UCM type item
if ($fieldParams->get('ucmItemOwner'))
{
$ucmItemTable->created_by = $fieldData['fieldsvalue'][$ownerShipFieldName];
}
}

if (!empty($fieldData['fieldsvalue'][$itemCategoryFieldName]))
Expand Down

0 comments on commit 0f22e58

Please sign in to comment.