Skip to content

Commit

Permalink
Added upload element "default on copy" check
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Apr 13, 2018
1 parent d87eb7a commit 6097de2
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions plugins/fabrik_element/fileupload/fileupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -3406,12 +3406,19 @@ protected function downloadLog($row, $filePath)
*/
public function onSaveAsCopy($val)
{
if (empty($val))
if ($this->defaultOnCopy())
{
$formModel = $this->getFormModel();
$origData = $formModel->getOrigData();
$name = $this->getFullName(true, false);
$val = $origData[$name];
$val = '';
}
else
{
if (empty($val))
{
$formModel = $this->getFormModel();
$origData = $formModel->getOrigData();
$name = $this->getFullName(true, false);
$val = $origData[$name];
}
}

return $val;
Expand Down

0 comments on commit 6097de2

Please sign in to comment.