Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 4.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Apr 9, 2018
2 parents 5853dc0 + 5aed4a7 commit e9ae0db
Show file tree
Hide file tree
Showing 33 changed files with 606 additions and 359 deletions.
8 changes: 2 additions & 6 deletions .drone.yml
Expand Up @@ -53,11 +53,7 @@ pipeline:
system-tests:
image: joomlaprojects/docker-systemtests:latest
commands:
- apache2ctl -D FOREGROUND &
- google-chrome --version
- chmod 755 libraries/vendor/joomla-projects/selenium-server-standalone/bin/webdrivers/chrome/linux/chromedriver
- mv libraries/vendor/joomla/test-system/src/acceptance.suite.dist.yml libraries/vendor/joomla/test-system/src/acceptance.suite.yml
- libraries/vendor/bin/robo run:tests
- bash libraries/vendor/joomla/test-system/src/drone-run.sh "$(pwd)"

services:
mysql:
Expand All @@ -75,4 +71,4 @@ services:
image: redis:alpine

postgres:
image: postgres
image: postgres
8 changes: 6 additions & 2 deletions administrator/components/com_contact/Table/ContactTable.php
Expand Up @@ -65,12 +65,11 @@ public function store($updateNulls = false)
$date = \JFactory::getDate()->toSql();
$userId = \JFactory::getUser()->id;

$this->modified = $date;

if ($this->id)
{
// Existing item
$this->modified_by = $userId;
$this->modified = $date;
}
else
{
Expand Down Expand Up @@ -243,6 +242,11 @@ public function check()
$this->metadata = '{}';
}

if (empty($this->modified))
{
$this->modified = $this->getDbo()->getNullDate();
}

return true;
}

Expand Down
8 changes: 6 additions & 2 deletions administrator/components/com_finder/Table/FilterTable.php
Expand Up @@ -108,6 +108,11 @@ public function check()
$this->params = (string) $params;
}

if (empty($this->modified))
{
$this->modified = $nullDate;
}

return true;
}

Expand Down Expand Up @@ -220,12 +225,11 @@ public function store($updateNulls = false)
$date = \JFactory::getDate()->toSql();
$userId = \JFactory::getUser()->id;

$this->modified = $date;

if ($this->filter_id)
{
// Existing item
$this->modified_by = $userId;
$this->modified = $date;
}
else
{
Expand Down
10 changes: 8 additions & 2 deletions administrator/components/com_media/tmpl/file/default.php
Expand Up @@ -27,14 +27,20 @@
*/
$form = $this->form;

$tmpl = JFactory::getApplication()->input->getCmd('tmpl', '');
$tmpl = JFactory::getApplication()->input->getCmd('tmpl');

// Load the toolbar when we are in an iframe
if ($tmpl == 'component')
{
echo JToolbar::getInstance('toolbar')->render();
}

// Populate the media config
$config = [
'apiBaseUrl' => JUri::root() . 'administrator/index.php?option=com_media&format=json',
'csrfToken' => JSession::getFormToken(),
'uploadPath' => $this->file->path,
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . $tmpl,
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . (!empty($tmpl) ? ('&tmpl=' . $tmpl) : ''),
'allowedUploadExtensions' => $params->get('upload_extensions', ''),
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
'contents' => base64_encode(file_get_contents($this->file->localpath)),
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_media/tmpl/media/default.php
Expand Up @@ -39,7 +39,7 @@
'filePath' => $params->get('file_path', 'images'),
'fileBaseUrl' => JUri::root() . $params->get('file_path', 'images'),
'fileBaseRelativeUrl' => $params->get('file_path', 'images'),
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . $tmpl,
'editViewUrl' => JUri::root() . 'administrator/index.php?option=com_media&view=file' . (!empty($tmpl) ? ('&tmpl=' . $tmpl) : ''),
'allowedUploadExtensions' => $params->get('upload_extensions', ''),
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
'providers' => (array) $this->providers,
Expand Down
Expand Up @@ -121,6 +121,11 @@ public function check()
$this->metadesc = StringHelper::str_ireplace($bad_characters, '', $this->metadesc);
}

if (empty($this->modified))
{
$this->modified = $this->getDbo()->getNullDate();
}

return true;
}

Expand All @@ -138,12 +143,11 @@ public function store($updateNulls = false)
$date = \JFactory::getDate();
$user = \JFactory::getUser();

$this->modified = $date->toSql();

if ($this->id)
{
// Existing item
$this->modified_by = $user->get('id');
$this->modified = $date->toSql();
}
else
{
Expand Down
8 changes: 6 additions & 2 deletions administrator/components/com_redirect/Table/LinkTable.php
Expand Up @@ -113,6 +113,11 @@ public function check()
return false;
}

if (empty($this->modified_date))
{
$this->modified_date = $this->getDbo()->getNullDate();
}

return true;
}

Expand All @@ -129,12 +134,11 @@ public function store($updateNulls = false)
{
$date = \JFactory::getDate()->toSql();

$this->modified_date = $date;

if (!$this->id)
{
// New record.
$this->created_date = $date;
$this->modified_date = $date;
}

return parent::store($updateNulls);
Expand Down
37 changes: 33 additions & 4 deletions administrator/components/com_users/Table/NoteTable.php
Expand Up @@ -48,16 +48,19 @@ public function store($updateNulls = false)
$date = \JFactory::getDate()->toSql();
$userId = \JFactory::getUser()->get('id');

$this->modified_time = $date;
$this->modified_user_id = $userId;

if (!((int) $this->review_time))
{
// Null date.
$this->review_time = \JFactory::getDbo()->getNullDate();
}

if (empty($this->id))
if ($this->id)
{
// Existing item
$this->modified_time = $date;
$this->modified_user_id = $userId;
}
else
{
// New record.
$this->created_time = $date;
Expand Down Expand Up @@ -158,4 +161,30 @@ public function publish($pks = null, $state = 1, $userId = 0)

return true;
}

/**
* Method to perform sanity checks on the Table instance properties to ensure they are safe to store in the database.
*
* @return boolean True if the instance is sane and able to be stored in the database.
*
* @since __DEPLOY_VERSION__
*/
public function check()
{
try
{
parent::check();
}
catch (\Exception $e)
{
$this->setError($e->getMessage());

return false;
}

if (empty($this->modified_time))
{
$this->modified_time = $this->getDbo()->getNullDate();
}
}
}
5 changes: 5 additions & 0 deletions components/com_content/View/Article/HtmlView.php
Expand Up @@ -75,6 +75,11 @@ class HtmlView extends BaseHtmlView
*/
public function display($tpl = null)
{
if ($this->getLayout() == 'pagebreak')
{
return parent::display($tpl);
}

$app = \JFactory::getApplication();
$user = \JFactory::getUser();

Expand Down

0 comments on commit e9ae0db

Please sign in to comment.