Skip to content

Commit

Permalink
Merge pull request #51 from DSE-Western-Thessaloniki/master
Browse files Browse the repository at this point in the history
Provide sane values for the database
  • Loading branch information
parapente authored Apr 28, 2024
2 parents 8dacb37 + 21925ba commit 9b41f95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions attachments_component/admin/src/Table/AttachmentTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ public function store($updateNulls = false)
$this->user_field_2 = $this->_db->escape($this->user_field_2);
$this->user_field_3 = $this->_db->escape($this->user_field_3);

// Change boolean values to numeric
$this->url_valid = $this->url_valid ? 1 : 0;
$this->url_relative = $this->url_relative ? 1 : 0;
$this->url_verify = $this->url_verify ? 1 : 0;

// Let the parent class do the real work!
return parent::store($updateNulls);
}
Expand Down
3 changes: 3 additions & 0 deletions attachments_component/site/src/Helper/AttachmentsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,9 @@ public static function add_url(&$attachment, &$parent, $verify, $relative_url=fa
$app = Factory::getApplication();
$input = $app->getInput();

// The attachment doesn't reside on our system
$attachment->filename_sys = '';

// Get the component parameters
$params = ComponentHelper::getParams('com_attachments');

Expand Down

0 comments on commit 9b41f95

Please sign in to comment.