Skip to content

Commit

Permalink
Merge branch '4.0-dev' into sunday_2
Browse files Browse the repository at this point in the history
  • Loading branch information
roland-d committed May 18, 2019
2 parents fe6a353 + 1ea9725 commit 8463233
Show file tree
Hide file tree
Showing 287 changed files with 5,316 additions and 1,534 deletions.
18 changes: 8 additions & 10 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ steps:
depends_on: [ restore-cache ]
commands:
- composer install --no-progress --no-suggest
# needed for system testing
- composer update joomla/test-system --no-progress --no-suggest
- composer update joomla/test-api --no-progress --no-suggest
- composer update joomla-projects/selenium-server-standalone --no-progress --no-suggest
- composer update joomla-projects/joomla-browser --no-progress --no-suggest
- npm install --unsafe-perm

- name: rebuild-cache
Expand Down Expand Up @@ -107,22 +102,25 @@ steps:
depends_on: [ javascript-tests ]
image: joomlaprojects/docker-systemtests:develop
commands:
- bash libraries/vendor/joomla/test-system/src/drone-run.sh "$(pwd)"
- bash tests/Codeception/drone-system-run.sh "$(pwd)"
shm_size: 1024000000

- name: api-tests
depends_on: [ system-tests ]
image: joomlaprojects/docker-systemtests:latest
commands:
- bash libraries/vendor/joomla/test-api/drone-run.sh "$(pwd)"
- bash tests/Codeception/drone-api-run.sh "$(pwd)"

- name: analysis4x
image: rips/rips-cli:1.2.1
depends_on: [ api-tests ]
when:
branch: 4.0-dev
repo:
- joomla/joomla-cms
branch:
- 4.0-dev
commands:
- export RIPS_BASE_URI='https://api.rips.joomla.org'
- if [ $DRONE_REPO_NAMESPACE != 'joomla' ]; then echo "The analysis check only run on the main repos"; exit 0; fi
- rips-cli rips:scan:start -a 3 -t 1 -R -k -p $(pwd) -t 1 -T $DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; }
environment:
RIPS_USERNAME:
Expand Down Expand Up @@ -159,6 +157,6 @@ services:

---
kind: signature
hmac: ccc8d591031582b24518b4f77723665fc0cae6d4b2c670f12ce13ca2e37e7e90
hmac: 95c208fa999c1f2f00b942b4c5cade9b5bcd2a87695eff53a6f189c2e554c509

...
4 changes: 2 additions & 2 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RoboFile extends \Robo\Tasks
* @var string
* @since 4.0.0
*/
private $testsPath = 'libraries/vendor/joomla/test-system/src/';
private $testsPath = 'tests/Codeception/';

/**
* @var array | null
Expand Down Expand Up @@ -480,7 +480,7 @@ private function getSuiteConfig($suite = 'acceptance')
{
if (!$this->suiteConfig)
{
$this->suiteConfig = Symfony\Component\Yaml\Yaml::parse(file_get_contents(__DIR__ . '/libraries/vendor/joomla/test-system/src/' . $suite . '.suite.yml'));
$this->suiteConfig = Symfony\Component\Yaml\Yaml::parse(file_get_contents(__DIR__ . '/tests/Codeception/' . $suite . '.suite.yml'));
}

return $this->suiteConfig;
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_actionlogs/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
label="COM_ACTIONLOGS_LOG_EXTENSIONS_LABEL"
description="COM_ACTIONLOGS_LOG_EXTENSIONS_DESC"
multiple="true"
default="com_banners,com_cache,com_categories,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_tags,com_templates,com_users"
default="com_banners,com_cache,com_categories,com_checkin,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_tags,com_templates,com_users"
/>
</fieldset>
</config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
UPDATE `#__extensions`
SET `params` = REPLACE(`params`, '"com_categories",', '"com_categories","com_checkin",')
WHERE `name` = 'com_actionlogs';

INSERT INTO `#__action_logs_extensions` (`extension`) VALUES
('com_checkin');
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ALTER TABLE `#__contact_details` MODIFY `publish_up` datetime NULL DEFAULT NULL;
ALTER TABLE `#__contact_details` MODIFY `publish_down` datetime NULL DEFAULT NULL;
ALTER TABLE `#__contact_details` MODIFY `checked_out_time` datetime NULL DEFAULT NULL;

UPDATE `#__contact_details` SET
`publish_up` = CASE WHEN `publish_up` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_up` END,
`publish_down` = CASE WHEN `publish_down` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `publish_down` END,
`checked_out_time` = CASE WHEN `checked_out_time` IN ('0000-00-00 00:00:00', '1000-01-01 00:00:00') THEN NULL ELSE `checked_out_time` END;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UPDATE `#__menu` SET `link`='index.php?option=com_banners&view=banners' WHERE `id`=3;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_banners' WHERE `id`=4;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_contact' WHERE `id`=9;
UPDATE `#__menu` SET `link`='index.php?option=com_newsfeeds&view=newsfeeds' WHERE `id`=14;
UPDATE `#__menu` SET `link`='index.php?option=com_categories&view=categories&extension=com_newsfeeds' WHERE `id`=15;
UPDATE `#__menu` SET `link`='index.php?option=com_redirect&view=links' WHERE `id`=16;
UPDATE `#__menu` SET `link`='index.php?option=com_search&view=searches' WHERE `id`=17;
UPDATE `#__menu` SET `link`='index.php?option=com_finder&view=index' WHERE `id`=18;
UPDATE `#__menu` SET `link`='index.php?option=com_tags&view=tags' WHERE `id`=20;
UPDATE `#__menu` SET `link`='index.php?option=com_associations&view=associations' WHERE `id`=22;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
UPDATE "#__extensions"
SET "params" = REPLACE("params", '"com_categories",', '"com_categories","com_checkin",')
WHERE "name" = 'com_actionlogs';

INSERT INTO "#__action_logs_extensions" ("extension") VALUES
('com_checkin');

SELECT setval('#__action_logs_extensions_id_seq', max(id)) FROM "#__action_logs_extensions";
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ALTER TABLE "#__contact_details" ALTER COLUMN "publish_up" DROP NOT NULL;
ALTER TABLE "#__contact_details" ALTER COLUMN "publish_up" DROP DEFAULT;

ALTER TABLE "#__contact_details" ALTER COLUMN "publish_down" DROP NOT NULL;
ALTER TABLE "#__contact_details" ALTER COLUMN "publish_down" DROP DEFAULT;

ALTER TABLE "#__contact_details" ALTER COLUMN "checked_out_time" DROP NOT NULL;
ALTER TABLE "#__contact_details" ALTER COLUMN "checked_out_time" DROP DEFAULT;

UPDATE "#__contact_details" SET
"publish_up" = CASE WHEN "publish_up" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_up" END,
"publish_down" = CASE WHEN "publish_down" = '1970-01-01 00:00:00' THEN NULL ELSE "publish_down" END,
"checked_out_time" = CASE WHEN "checked_out_time" = '1970-01-01 00:00:00' THEN NULL ELSE "checked_out_time" END;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UPDATE "#__menu" SET "link"='index.php?option=com_banners&view=banners' WHERE "id"=3;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_banners' WHERE "id"=4;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_contact' WHERE "id"=9;
UPDATE "#__menu" SET "link"='index.php?option=com_newsfeeds&view=newsfeeds' WHERE "id"=14;
UPDATE "#__menu" SET "link"='index.php?option=com_categories&view=categories&extension=com_newsfeeds' WHERE "id"=15;
UPDATE "#__menu" SET "link"='index.php?option=com_redirect&view=links' WHERE "id"=16;
UPDATE "#__menu" SET "link"='index.php?option=com_search&view=searches' WHERE "id"=17;
UPDATE "#__menu" SET "link"='index.php?option=com_finder&view=index' WHERE "id"=18;
UPDATE "#__menu" SET "link"='index.php?option=com_tags&view=tags' WHERE "id"=20;
UPDATE "#__menu" SET "link"='index.php?option=com_associations&view=associations' WHERE "id"=22;
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
defined('JPATH_BASE') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

/** @var array $displayData */
$data = $displayData;
Expand Down Expand Up @@ -39,7 +40,7 @@
$data['options'] = array_merge($customOptions, $data['options']);

// Load search tools
JHtml::_('searchtools.form', $data['options']['formSelector'], $data['options']);
HTMLHelper::_('searchtools.form', $data['options']['formSelector'], $data['options']);

$filtersClass = isset($data['view']->activeFilters) && $data['view']->activeFilters ? ' js-stools-container-filters-visible' : '';
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
HTMLHelper::_('draggablelist.draggable');
}
?>
<form action="<?php echo Route::_('index.php?option=com_categories&view=categories'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_categories&view=categories&extension=' . $this->state->get('filter.extension')); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="col-md-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>

<?php echo JHtml::_('uitab.endTabSet'); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>

<?php echo $this->form->getInput('extension'); ?>
<input type="hidden" name="task" value="">
Expand Down
11 changes: 7 additions & 4 deletions administrator/components/com_checkin/Model/CheckinModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ public function checkin($ids = array())
// This int will hold the checked item count.
$results = 0;

$app = Factory::getApplication();

foreach ($ids as $tn)
{
// Make sure we get the right tables based on prefix.
if (stripos($tn, Factory::getApplication()->get('dbprefix')) !== 0)
if (stripos($tn, $app->get('dbprefix')) !== 0)
{
continue;
}
Expand All @@ -108,15 +110,16 @@ public function checkin($ids = array())

$query = $db->getQuery(true)
->update($db->quoteName($tn))
->set('checked_out = DEFAULT')
->set('checked_out_time = ' . $db->quote($nullDate))
->where('checked_out > 0');
->set($db->quoteName('checked_out') . ' = DEFAULT')
->set($db->quoteName('checked_out_time') . ' = ' . $db->quote($nullDate))
->where($db->quoteName('checked_out') . ' > 0');

$db->setQuery($query);

if ($db->execute())
{
$results = $results + $db->getAffectedRows();
$app->triggerEvent('onAfterCheckin', array($tn));
}
}

Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_config/Field/FiltersField.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function getInput()
$html[] = ' ' . LayoutHelper::render('joomla.html.treeprefix', array('level' => $group->level + 1)) . $group->text;
$html[] = ' </td>';
$html[] = ' <td>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_type" class="sr-only">' . \JText::_('JGLOBAL_FILTER_TYPE_LABEL') . '</label>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_type" class="sr-only">' . Text::_('JGLOBAL_FILTER_TYPE_LABEL') . '</label>';
$html[] = ' <select'
. ' name="' . $this->name . '[' . $group->value . '][filter_type]"'
. ' id="' . $this->id . $group->value . '_filter_type"'
Expand All @@ -108,7 +108,7 @@ protected function getInput()
$html[] = ' </select>';
$html[] = ' </td>';
$html[] = ' <td>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_tags" class="sr-only">' . \JText::_('JGLOBAL_FILTER_TAGS_LABEL') . '</label>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_tags" class="sr-only">' . Text::_('JGLOBAL_FILTER_TAGS_LABEL') . '</label>';
$html[] = ' <input'
. ' name="' . $this->name . '[' . $group->value . '][filter_tags]"'
. ' type="text"'
Expand All @@ -118,7 +118,7 @@ protected function getInput()
$html[] = ' </td>';
$html[] = ' <td>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_attributes"'
. ' class="sr-only">' . \JText::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL') . '</label>';
. ' class="sr-only">' . Text::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL') . '</label>';
$html[] = ' <input'
. ' name="' . $this->name . '[' . $group->value . '][filter_attributes]"'
. ' type="text"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,16 @@ public function save($data)
{
try
{
\JLog::add(
\JText::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']),
\JLog::WARNING,
Log::add(
Text::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']),
Log::WARNING,
'jerror'
);
}
catch (\RuntimeException $logException)
{
$app->enqueueMessage(
\JText::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']),
Text::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']),
'warning'
);
}
Expand Down
37 changes: 22 additions & 15 deletions administrator/components/com_contact/Table/ContactTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
*/
class ContactTable extends Table
{
/**
* Indicates that columns fully support the NULL value in the database
*
* @var boolean
* @since 4.0.0
*/
protected $_supportNullValue = true;

/**
* Ensure the params and metadata in json encoded in the bind method
*
Expand Down Expand Up @@ -58,7 +66,7 @@ public function __construct(DatabaseDriver $db)
*
* @since 1.6
*/
public function store($updateNulls = false)
public function store($updateNulls = true)
{
// Transform the params field
if (is_array($this->params))
Expand Down Expand Up @@ -91,18 +99,6 @@ public function store($updateNulls = false)
}
}

// Set publish_up to null date if not set
if (!$this->publish_up)
{
$this->publish_up = $this->_db->getNullDate();
}

// Set publish_down to null date if not set
if (!$this->publish_down)
{
$this->publish_down = $this->_db->getNullDate();
}

// Set xreference to empty string if not set
if (!$this->xreference)
{
Expand Down Expand Up @@ -253,9 +249,20 @@ public function check()
$this->metadata = '{}';
}

if (empty($this->modified))
// Set publish_up, publish_down to null if not set
if (!$this->publish_up)
{
$this->publish_up = null;
}

if (!$this->publish_down)
{
$this->publish_down = null;
}

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

return true;
Expand Down
18 changes: 18 additions & 0 deletions administrator/components/com_contact/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,12 @@
description="COM_CONTACT_CONFIG_INTEGRATION_SETTINGS_DESC"
>

<field
name="integration_newsfeeds"
type="note"
label="JGLOBAL_FEED_TITLE"
/>

<field
name="show_feed_link"
type="radio"
Expand All @@ -972,6 +978,12 @@
<option value="1">JSHOW</option>
</field>

<field
name="integration_sef"
type="note"
label="JGLOBAL_SEF_TITLE"
/>

<field
name="sef_ids"
type="radio"
Expand All @@ -983,6 +995,12 @@
<option value="1">JYES</option>
</field>

<field
name="integration_customfields"
type="note"
label="JGLOBAL_FIELDS_TITLE"
/>

<field
name="custom_fields_enable"
type="radio"
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_content/Model/ArticlesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Workflow\Workflow;
Expand Down Expand Up @@ -586,7 +587,7 @@ public function getTransitions()
// Update the transition text with final state value
$conditionName = $workflow->getConditionName($transition['stage_condition']);

$transitions[$key]['text'] .= ' [' . \JText::_($conditionName) . ']';
$transitions[$key]['text'] .= ' [' . Text::_($conditionName) . ']';
}
}

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_content/Model/FeaturedModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ protected function getListQuery()
$baselevel = 1;
$categoryId = $this->getState('filter.category_id');

if (is_numeric($categoryId))
if (is_array($categoryId) && count($categoryId) === 1)
{
$cat_tbl = \JTable::getInstance('Category', 'JTable');
$cat_tbl->load($categoryId);
$cat_tbl->load($categoryId[0]);
$rgt = $cat_tbl->rgt;
$lft = $cat_tbl->lft;
$baselevel = (int) $cat_tbl->level;
Expand Down

0 comments on commit 8463233

Please sign in to comment.