Skip to content

Commit

Permalink
#4558 - Build-in API support (events & forms)
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov committed Dec 14, 2023
1 parent 6994302 commit bb49d63
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inc/classes/BxDolForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ function getCleanValue ($sName)
$oRv = $oChecker->get ($sName);

// process comma separated string for api values
if (bx_is_api() && isset($this->aInputs[$sName]['type']) && !empty($oRv) && in_array($this->aInputs[$sName]['type'], ['checkbox_set', 'files', 'select_multiple']))
if (bx_is_api() && isset($this->aInputs[$sName]['type']) && !empty($oRv) && (in_array($this->aInputs[$sName]['type'], ['checkbox_set', 'files', 'select_multiple']) || in_array($sName, ['labels'])))
$oRv = explode(',', $oRv);

return $oRv;
Expand Down
3 changes: 2 additions & 1 deletion template/scripts/BxBaseFormView.php
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,8 @@ protected function genCustomInputLabels (&$aInput)

if (bx_is_api()){
$aInput['type'] = 'labels';
$aInput['ajax_get_suggestions'] = 'system/select_labels/TemplLabelsServices&params[]=';
//$aInput['ajax_get_suggestions'] = 'system/select_labels/TemplLabelsServices&params[]=';
$aInput['values'] = bx_srv('system', 'get_labels', [], 'TemplLabelsServices');
}

return $this->oTemplate->parseHtmlByName('label_select_field.html', array(
Expand Down
2 changes: 1 addition & 1 deletion template/scripts/BxBasePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public function getPageAPI ($aBlocks = [])
'id' => $this->_aObject['id'],
'title' => $this->_getPageTitle(),
'uri' => $this->_aObject['uri'],
'url' => $this->_aObject['uri'] . (bx_get('params')[0] . ($query_string != '' ? '?' . $query_string : '')),
'url' => ((bx_get('params')[0] ? bx_get('params')[0] : $this->_aObject['uri'] ) . ($query_string != '' ? '?' . $query_string : '')),
'author' => $this->_aObject['author'],
'added' => $this->_aObject['added'],
'module' => $this->getModule(),
Expand Down

0 comments on commit bb49d63

Please sign in to comment.