Skip to content

Commit

Permalink
Merge branch '4.0-dev' into a11y-aria-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
chmst committed Feb 17, 2019
2 parents 0c47702 + 23d5fb7 commit 2a584cd
Show file tree
Hide file tree
Showing 603 changed files with 4,257 additions and 5,345 deletions.
13 changes: 12 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# A list of files to ignore from linting
# TODO: Fix the webcomponents codestyle then also allow linting on them
*.js
!*.es6.js
administrator/components/com_media/node_modules/uri-js/node_modules/punycode/punycode.es6.js
media
*.vue
# TODO: Fix the webcomponents codestyle then also allow linting on them
joomla-editor-codemirror.w-c.es6.js
joomla-field-fancy-select.w-c.es6.js
joomla-field-media.w-c.es6.js
joomla-field-module-order.w-c.es6.js
joomla-field-permissions.w-c.es6.js
joomla-field-send-test-mail.w-c.es6.js
joomla-field-simple-color.w-c.es6.js
joomla-field-subform.w-c.es6.js
joomla-field-switcher.w-c.es6.js
# End of TODO
46 changes: 23 additions & 23 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins/fields/* @laoneo
plugins/systems/fields/* @laoneo

# Smart Search
administrator/components/com_finder/* @mbabker
components/com_finder/* @mbabker
modules/mod_finder/* @mbabker
plugins/content/finder/* @mbabker
plugins/finder/* @mbabker
#administrator/components/com_finder/*
#components/com_finder/*
#modules/mod_finder/*
#plugins/content/finder/*
#plugins/finder/*

# Language strings
administrator/language/en-GB/* @brianteeman
Expand All @@ -28,33 +28,33 @@ plugins/editors/codemirror/* @okonomiyaki3000
plugins/system/stats/* @mbabker @wilsonge

# Release Tools
build.xml @mbabker
build/build.php @mbabker @rdeutz @wilsonge
build/bump.php @mbabker @rdeutz @wilsonge
build/deleted_file_check.php @mbabker @rdeutz @wilsonge
build.xml @wilsonge
build/build.php @rdeutz @wilsonge
build/bump.php @rdeutz @wilsonge
build/deleted_file_check.php @rdeutz @wilsonge

# Core/Extension Install/Update Tools
administrator/components/com_joomlaupdate/* @mbabker @rdeutz @wilsonge @zero-24
libraries/src/Installer/* @mbabker @rdeutz @wilsonge @zero-24
libraries/src/Updater/* @mbabker @rdeutz @wilsonge @zero-24
administrator/components/com_joomlaupdate/* @rdeutz @wilsonge @zero-24
libraries/src/Installer/* @rdeutz @wilsonge @zero-24
libraries/src/Updater/* @rdeutz @wilsonge @zero-24

# Automated Testing
build/jenkins/* @mbabker @rdeutz
build/travis/* @mbabker @rdeutz
build/jenkins/* @rdeutz
build/travis/* @rdeutz
tests/codeception/* @rdeutz
tests/javascript/* @dgt41 @rdeutz
tests/unit/* @mbabker @rdeutz
.appveyor.yml @mbabker @rdeutz
tests/javascript/* @dgrammatiko @rdeutz
tests/unit/* @rdeutz
.appveyor.yml @rdeutz
.drone.yml @rdeutz
.hound.yml @mbabker
.travis.yml @mbabker @rdeutz
appveyor-phpunit.xml @mbabker @rdeutz
.hound.yml @wilsonge
.travis.yml @rdeutz
appveyor-phpunit.xml @rdeutz
codeception.yml @rdeutz
karma.conf.js @dgt41 @rdeutz
phpunit.xml.dist @mbabker @rdeutz
karma.conf.js @dgrammatiko @rdeutz
phpunit.xml.dist @rdeutz
RoboFile.dist.ini @rdeutz
RoboFile.php @rdeutz
travis-phpunit.xml @mbabker @rdeutz
travis-phpunit.xml @rdeutz

# Core JS
media/*/js/* @dgt41
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `#__finder_terms`
DROP INDEX `idx_term`,
ADD UNIQUE INDEX `idx_term` (`term`, `language`);
ALTER TABLE `#__finder_terms`
ADD INDEX `language` (`language`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE "#__finder_terms"
DROP CONSTRAINT "#__finder_terms_idx_term",
ADD CONSTRAINT "#__finder_terms_idx_term_language" UNIQUE ("term", "language");
CREATE INDEX "#__finder_terms_idx_language" on "#__finder_terms" ("language");
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
\Joomla\CMS\Factory::getDocument()->addScriptOptions('category-change', $id);

HTMLHelper::_('script', 'layouts/joomla/form/field/category-change.min.js', ['version' => 'auto', 'relative' => true], ['defer' => true]);
HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('webcomponent', 'system/fields/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]);
?>

<joomla-field-fancy-select <?php echo $attr2; ?>><?php echo implode($html); ?></joomla-field-fancy-select>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
defined('_JEXEC') or die;

HTMLHelper::_('form.csrf');
HTMLHelper::_('webcomponent', 'system/webcomponents/joomla-field-send-test-mail.min.js', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('webcomponent', 'system/fields/joomla-field-send-test-mail.min.js', ['version' => 'auto', 'relative' => true]);

// Load JavaScript message titles
Text::script('ERROR');
Expand Down
Empty file modified administrator/components/com_config/tmpl/component/default.xml
100755 → 100644
Empty file.
6 changes: 6 additions & 0 deletions administrator/components/com_contact/Table/ContactTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ public function check()
return false;
}

if (!$this->id)
{
// Hits must be zero on a new item
$this->hits = 0;
}

/*
* Clean up keywords -- eliminate extra spaces between phrases
* and cr (\r) and lf (\n) characters from string.
Expand Down
14 changes: 2 additions & 12 deletions administrator/components/com_content/Model/ArticleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ protected function batchCopy($value, $pks, $contexts)
// Reset hits because we are making a copy
$this->table->hits = 0;

// Unpublish because we are making a copy
$this->table->state = 0;

// New category ID
$this->table->catid = $categoryId;

Expand Down Expand Up @@ -429,12 +426,12 @@ protected function canEditState($record)
protected function prepareTable($table)
{
// Set the publish date to now
if ($table->state == 1 && (int) $table->publish_up == 0)
if ($table->state == Workflow::CONDITION_PUBLISHED && (int) $table->publish_up == 0)
{
$table->publish_up = Factory::getDate()->toSql();
}

if ($table->state == 1 && intval($table->publish_down) == 0)
if ($table->state == Workflow::CONDITION_PUBLISHED && intval($table->publish_down) == 0)
{
$table->publish_down = $this->getDbo()->getNullDate();
}
Expand Down Expand Up @@ -711,12 +708,6 @@ public function getForm($data = array(), $loadData = true)
}
}

// Remove show_associations field if associations is not enabled
if (!$assoc)
{
$form->removeField('show_associations', 'attribs');
}

return $form;
}

Expand Down Expand Up @@ -960,7 +951,6 @@ public function save($data)
}

$data['state'] = (int) $stage->condition;

}

// Automatic handling of alias for empty fields
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_content/Service/HTML/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Workflow\Workflow;
use Joomla\Component\Mailto\Site\Helper\MailtoHelper;
use Joomla\Registry\Registry;

Expand Down Expand Up @@ -146,7 +147,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false)
}

// Ignore if the state is negative (trashed).
if ($article->state < 0)
if (!in_array($article->state, [Workflow::CONDITION_UNPUBLISHED, Workflow::CONDITION_PUBLISHED]))
{
return;
}
Expand Down Expand Up @@ -175,7 +176,7 @@ public function edit($article, $params, $attribs = array(), $legacy = false)
$contentUrl = \ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language);
$url = $contentUrl . '&task=article.edit&a_id=' . $article->id . '&return=' . base64_encode($uri);

if ($article->state == 0)
if ($article->state == Workflow::CONDITION_UNPUBLISHED)
{
$overlib = Text::_('JUNPUBLISHED');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo)
);


echo '<input type="hidden" class="form-control" id="' . $modalId . '_name" type="text" value="">';
echo '<input type="hidden" class="form-control" id="' . $modalId . '_name" value="">';
echo '<input type="hidden" id="' . $modalId . '_id" value="0">';
}
}
Expand Down
Empty file modified administrator/components/com_content/tmpl/article/edit.xml
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<td style="width:1%" class="text-center">
<?php echo HTMLHelper::_('grid.checkall'); ?>
</td>
<th scope="col" style="width:1%" class="text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JFEATURED', 'a.featured', $listDirn, $listOrder); ?>
</th>
<th scope="col" style="width:1%" class="text-center">
<?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
Expand Down Expand Up @@ -226,10 +229,12 @@
<td class="text-center">
<?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', $item->title); ?>
</td>
<td class="text-center">
<?php echo $featuredButton->render($item->featured, $i, ['disabled' => !$canChange]); ?>
</td>
<td class="article-status">
<div class="d-flex">
<div class="btn-group tbody-icon mr-1">
<?php echo $featuredButton->render($item->featured, $i, ['disabled' => !$canChange]); ?>
<?php

$options = [
Expand Down
5 changes: 5 additions & 0 deletions administrator/components/com_fields/Table/FieldTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public function check()
$this->created_time = $date->toSql();
}

if (!(int) $this->modified_time)
{
$this->modified_time = $date->toSql();
}

if (empty($this->created_user_id))
{
$this->created_user_id = $user->get('id');
Expand Down
22 changes: 22 additions & 0 deletions administrator/components/com_finder/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,28 @@
<option value="">COM_FINDER_CONFIG_LANGUAGE_DEFAULT_NONE</option>
</field>

<field
name="filter_commonwords"
type="radio"
label="COM_FINDER_CONFIG_FILTER_COMMONWORDS_LABEL"
class="switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="filter_numerics"
type="radio"
label="COM_FINDER_CONFIG_FILTER_NUMERICS_LABEL"
class="switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

</fieldset>

<fieldset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ public function index($item, $format = 'html')
' FROM ' . $db->quoteName('#__finder_tokens') . ' AS t1' .
' WHERE t1.context = %d' .
' ) AS t1' .
' JOIN ' . $db->quoteName('#__finder_tokens') . ' AS t2 ON t2.term = t1.term' .
' LEFT JOIN ' . $db->quoteName('#__finder_terms') . ' AS t ON t.term = t1.term' .
' JOIN ' . $db->quoteName('#__finder_tokens') . ' AS t2 ON t2.term = t1.term AND t2.language = t1.language' .
' LEFT JOIN ' . $db->quoteName('#__finder_terms') . ' AS t ON t.term = t1.term AND t.language = t1.language' .
' WHERE t2.context = %d' .
' GROUP BY t1.term, t.term_id, t1.term, t1.stem, t1.common, t1.phrase, t1.weight, t1.context, t1.language' .
' ORDER BY t1.term DESC';
Expand Down Expand Up @@ -347,7 +347,7 @@ public function index($item, $format = 'html')
*/
$query = $db->getQuery(true)
->update($db->quoteName('#__finder_tokens_aggregate') . ' AS ta')
->join('INNER', $db->quoteName('#__finder_terms') . ' AS t ON t.term = ta.term')
->join('INNER', $db->quoteName('#__finder_terms') . ' AS t ON t.term = ta.term AND t.language = ta.language')
->set('ta.term_id = t.term_id')
->where('ta.term_id = 0');
$db->setQuery($query);
Expand Down
34 changes: 24 additions & 10 deletions administrator/components/com_finder/helpers/indexer/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,26 +269,40 @@ public static function addContentType($title, $mime = null)
*/
public static function isCommon($token, $lang)
{
static $data;
static $default;
static $data, $default, $multilingual;

$langCode = $lang;
if (is_null($multilingual))
{
$multilingual = Multilanguage::isEnabled();
$config = ComponentHelper::getParams('com_finder');

if ($config->get('language_default', '') == '')
{
$default = '*';
}
elseif ($config->get('language_default', '') == '-1')
{
$default = self::getPrimaryLanguage(self::getDefaultLanguage());
}
else
{
$default = self::getPrimaryLanguage($config->get('language_default'));
}
}

// If language requested is wildcard, use the default language.
if ($lang == '*')
if (!$multilingual || $lang == '*')
{
$default = $default === null ? substr(self::getDefaultLanguage(), 0, 2) : $default;
$langCode = $default;
$lang = $default;
}

// Load the common tokens for the language if necessary.
if (!isset($data[$langCode]))
if (!isset($data[$lang]))
{
$data[$langCode] = self::getCommonWords($langCode);
$data[$lang] = self::getCommonWords($lang);
}

// Check if the token is in the common array.
return in_array($token, $data[$langCode], true);
return in_array($token, $data[$lang], true);
}

/**
Expand Down

0 comments on commit 2a584cd

Please sign in to comment.