Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 4.1-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Sep 22, 2020
2 parents e77aeb7 + 96e3c63 commit 2d6d591
Show file tree
Hide file tree
Showing 75 changed files with 568 additions and 646 deletions.
@@ -0,0 +1 @@
UPDATE `#__menu` SET `link`='index.php?option=com_finder' WHERE `menutype`='main' AND `title`='com_finder' AND `link`='index.php?option=com_finder&view=index';
@@ -0,0 +1 @@
UPDATE "#__menu" SET "link"='index.php?option=com_finder' WHERE "menutype"='main' AND "title"='com_finder' AND "link"='index.php?option=com_finder&view=index';
4 changes: 2 additions & 2 deletions administrator/components/com_contact/forms/contact.xml
Expand Up @@ -725,9 +725,9 @@
/>

<field
name="linkd_name"
name="linkb_name"
type="text"
label="COM_CONTACT_FIELD_LINKD_NAME_LABEL"
label="COM_CONTACT_FIELD_LINKB_NAME_LABEL"
size="30"
/>

Expand Down
32 changes: 12 additions & 20 deletions administrator/components/com_contact/src/Service/HTML/Icon.php
Expand Up @@ -117,9 +117,6 @@ public static function edit($contact, $params, $attribs = array(), $legacy = fal
return '';
}

// Set the link class
$attribs['class'] = 'dropdown-item';

// Show checked_out icon if the contact is checked out by a different user
if (property_exists($contact, 'checked_out')
&& property_exists($contact, 'checked_out_time')
Expand All @@ -128,11 +125,12 @@ public static function edit($contact, $params, $attribs = array(), $legacy = fal
{
$checkoutUser = Factory::getUser($contact->checked_out);
$date = HTMLHelper::_('date', $contact->checked_out_time);
$tooltip = Text::_('JLIB_HTML_CHECKED_OUT') . ' :: ' . Text::sprintf('COM_CONTACT_CHECKED_OUT_BY', $checkoutUser->name)
. ' <br /> ' . $date;
$tooltip = Text::sprintf('COM_CONTACT_CHECKED_OUT_BY', $checkoutUser->name)
. ' <br> ' . $date;

$text = LayoutHelper::render('joomla.content.icons.edit_lock', array('tooltip' => $tooltip, 'legacy' => $legacy));
$text = LayoutHelper::render('joomla.content.icons.edit_lock', array('contact' => $contact, 'tooltip' => $tooltip, 'legacy' => $legacy));

$attribs['aria-describedby'] = 'editcontact-' . (int) $contact->id;
$output = HTMLHelper::_('link', '#', $text, $attribs);

return $output;
Expand All @@ -143,21 +141,13 @@ public static function edit($contact, $params, $attribs = array(), $legacy = fal

if ((int) $contact->published === 0)
{
$overlib = Text::_('JUNPUBLISHED');
$tooltip = Text::_('COM_CONTACT_EDIT_UNPUBLISHED_CONTACT');
}
else
{
$overlib = Text::_('JPUBLISHED');
$tooltip = Text::_('COM_CONTACT_EDIT_PUBLISHED_CONTACT');
}

$date = HTMLHelper::_('date', $contact->created);
$author = $contact->created_by_alias ?: Factory::getUser($contact->created_by)->name;

$overlib .= '&lt;br /&gt;';
$overlib .= $date;
$overlib .= '&lt;br /&gt;';
$overlib .= Text::sprintf('COM_CONTACT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));

$nowDate = strtotime(Factory::getDate());
$icon = $contact->published ? 'edit' : 'eye-slash';

Expand All @@ -168,12 +158,14 @@ public static function edit($contact, $params, $attribs = array(), $legacy = fal
$icon = 'eye-slash';
}

$text = '<span class="hasTooltip fas fa-' . $icon . '" title="'
. HTMLHelper::tooltipText(Text::_('COM_CONTACT_EDIT_CONTACT'), $overlib, 0, 0) . '"></span> ';
$aria_described = 'editcontact-' . (int) $contact->id;

$text = '<span class="fas fa-' . $icon . '" aria-hidden="true"></span>';
$text .= Text::_('JGLOBAL_EDIT');
$text .= '<div role="tooltip" id="' . $aria_described . '">' . $tooltip . '</div>';

$attribs['title'] = Text::_('COM_CONTACT_EDIT_CONTACT');
$output = HTMLHelper::_('link', Route::_($url), $text, $attribs);
$attribs['aria-describedby'] = $aria_described;
$output = HTMLHelper::_('link', Route::_($url), $text, $attribs);

return $output;
}
Expand Down
46 changes: 38 additions & 8 deletions administrator/components/com_fields/src/Model/FieldsModel.php
Expand Up @@ -11,7 +11,8 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Categories\Categories;
use Joomla\CMS\Categories\CategoryServiceInterface;
use Joomla\CMS\Categories\SectionNotFoundException;
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\ListModel;
Expand Down Expand Up @@ -199,14 +200,43 @@ protected function getListQuery()

if ($parts)
{
// Get the category
$cat = Categories::getInstance(str_replace('com_', '', $parts[0]) . '.' . $parts[1]);
// Get the categories for this component (and optionally this section, if available)
$cat = (
function () use ($parts) {
// Get the CategoryService for this component
$componentObject = $this->bootComponent($parts[0]);

// If there is no category for the component and section, so check the component only
if (!$cat)
{
$cat = Categories::getInstance(str_replace('com_', '', $parts[0]));
}
if (!$componentObject instanceof CategoryServiceInterface)
{
// No CategoryService -> no categories
return null;
}

$cat = null;

// Try to get the categories for this component and section
try
{
$cat = $componentObject->getCategory([], $parts[1] ?: '');
}
catch (SectionNotFoundException $e)
{
// Not found for component and section -> Now try once more without the section, so only component
try
{
$cat = $componentObject->getCategory();
}
catch (SectionNotFoundException $e)
{
// If we haven't found it now, return (no categories available for this component)
return null;
}
}

// So we found categories for at least the component, return them
return $cat;
}
)();

if ($cat)
{
Expand Down
84 changes: 74 additions & 10 deletions administrator/components/com_installer/src/Model/DatabaseModel.php
Expand Up @@ -18,6 +18,7 @@
use Joomla\CMS\Table\Extension;
use Joomla\CMS\Version;
use Joomla\Component\Installer\Administrator\Helper\InstallerHelper;
use Joomla\Database\DatabaseQuery;
use Joomla\Database\Exception\ExecutionFailureException;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;
Expand Down Expand Up @@ -145,18 +146,69 @@ private function fetchSchemaCache($cid = 0)
}

$db = $this->getDbo();
$folderTmp = JPATH_ADMINISTRATOR . '/components/' . $result->element . '/sql/updates/';

// If the extension doesn't follow the standard location for the
// update sql files we don't support it
if ($result->type === 'component')
{
$basePath = JPATH_ADMINISTRATOR . '/components/' . $result->element;
}
elseif ($result->type === 'plugin')
{
$basePath = JPATH_PLUGINS . '/' . $result->folder . '/' . $result->element;
}
elseif ($result->type === 'module')
{
// Typehint to integer to normalise some DBs returning strings and others integers
if ((int) $result->client_id === 1)
{
$basePath = JPATH_ADMINISTRATOR . '/modules/' . $result->element;
}
elseif ((int) $result->client_id === 0)
{
$basePath = JPATH_SITE . '/modules/' . $result->element;
}
else
{
// Module with unknown client id!? - bail
continue;
}
}
// Specific bodge for the Joomla CMS special database check which points to com_admin
elseif ($result->type === 'file' && $result->element === 'com_admin')
{
$basePath = JPATH_ADMINISTRATOR . '/components/' . $result->element;
}
else
{
// Unknown extension type (library, files etc which don't have known SQL paths right now)
continue;
}

// Search the standard SQL Path for the SQL Updates and then if not there check the configuration of the XML
// file. This just gives us a small performance win of not parsing the XML every time.
$folderTmp = $basePath . '/sql/updates/';

if (!file_exists($folderTmp))
{
$installationXML = InstallerHelper::getInstallationXML($result->element, $result->type);
$folderTmp = (string) $installationXML->update->schemas->schemapath[0];
$installationXML = InstallerHelper::getInstallationXML(
$result->element,
$result->type,
$result->client_id,
$result->type === 'plugin' ? $result->folder : null
);

if ($installationXML !== null)
{
$folderTmp = (string) $installationXML->update->schemas->schemapath[0];
$a = explode('/', $folderTmp);
array_pop($a);
$folderTmp = $basePath . '/' . implode('/', $a);
}
}

$a = explode('/', $folderTmp);
array_pop($a);
$folderTmp = JPATH_ADMINISTRATOR . '/components/' . $result->element . '/' . implode('/', $a);
// Can't find the folder still - give up now and move on.
if (!file_exists($folderTmp))
{
continue;
}

$changeSet = new ChangeSet($db, $folderTmp);
Expand All @@ -165,6 +217,12 @@ private function fetchSchemaCache($cid = 0)
// than the update files, add to problems message
$schema = $changeSet->getSchema();

// If the schema is empty we couldn't find any update files. Just ignore the extension.
if (empty($schema))
{
continue;
}

if ($result->version_id !== $schema)
{
$errorMessages[] = Text::sprintf('COM_INSTALLER_MSG_DATABASE_SCHEMA_ERROR', $result->version_id, $schema);
Expand Down Expand Up @@ -301,7 +359,7 @@ public function getItems()
/**
* Method to get the database query
*
* @return \JDatabaseQuery The database query
* @return DatabaseQuery The database query
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -502,7 +560,13 @@ public function compareUpdateVersion($extension)
}
else
{
$installationXML = InstallerHelper::getInstallationXML($extension->element, $extension->type);
$installationXML = InstallerHelper::getInstallationXML(
$extension->element,
$extension->type,
$extension->client_id,
$extension->type === 'plugin' ? $extension->folder : null
);

$extensionVersion = (string) $installationXML->version;
}

Expand Down
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Database\DatabaseQuery;
use Joomla\Utilities\ArrayHelper;

/**
Expand Down Expand Up @@ -54,9 +55,9 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
/**
* Returns an object list
*
* @param \JDatabaseQuery $query The query
* @param int $limitstart Offset
* @param int $limit The number of records
* @param DatabaseQuery $query The query
* @param int $limitstart Offset
* @param int $limit The number of records
*
* @return array
*/
Expand Down
@@ -1,5 +1,5 @@
<template>
<div class="media-toolbar"role="toolbar" :aria-label="translate('COM_MEDIA_TOOLBAR_LABEL')">
<div class="media-toolbar" role="toolbar" :aria-label="translate('COM_MEDIA_TOOLBAR_LABEL')">
<div class="media-loader" v-if="isLoading"></div>
<div class="media-view-icons">
<a href="#" class="media-toolbar-icon media-toolbar-select-all"
Expand Down
Expand Up @@ -124,7 +124,7 @@ public function oauthcallback()
// Redirect browser to Media Manager
case 'media-manager':
default:
$this->setRedirect(Route::_('index.php?option=com_media', false));
$this->setRedirect(Route::_('index.php?option=com_media&view=media', false));
}
}
catch (\Exception $e)
Expand Down
4 changes: 4 additions & 0 deletions administrator/components/com_media/src/Model/FileModel.php
Expand Up @@ -11,6 +11,7 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\MVC\Model\FormModel;
use Joomla\CMS\Plugin\PluginHelper;

Expand All @@ -35,6 +36,9 @@ public function getForm($data = [], $loadData = true)
{
PluginHelper::importPlugin('media-action');

// Load backend forms in frontend.
FormHelper::addFormPath(JPATH_ADMINISTRATOR . '/components/com_media/forms');

// Get the form.
$form = $this->loadForm('com_media.file', 'file', ['control' => 'jform', 'load_data' => $loadData]);

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_media/tmpl/file/default.php
Expand Up @@ -39,10 +39,10 @@

// Populate the media config
$config = [
'apiBaseUrl' => Uri::root() . 'administrator/index.php?option=com_media&format=json',
'apiBaseUrl' => Uri::base() . 'index.php?option=com_media&format=json',
'csrfToken' => Session::getFormToken(),
'uploadPath' => $this->file->path,
'editViewUrl' => Uri::root() . 'administrator/index.php?option=com_media&view=file' . (!empty($tmpl) ? ('&tmpl=' . $tmpl) : ''),
'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : ''),
'allowedUploadExtensions' => $params->get('upload_extensions', ''),
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
'contents' => $this->file->content,
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_media/tmpl/media/default.php
Expand Up @@ -37,12 +37,12 @@

// Populate the media config
$config = array(
'apiBaseUrl' => Uri::root() . 'administrator/index.php?option=com_media&format=json',
'apiBaseUrl' => Uri::base() . 'index.php?option=com_media&format=json',
'csrfToken' => Session::getFormToken(),
'filePath' => $params->get('file_path', 'images'),
'fileBaseUrl' => Uri::root() . $params->get('file_path', 'images'),
'fileBaseRelativeUrl' => $params->get('file_path', 'images'),
'editViewUrl' => Uri::root() . 'administrator/index.php?option=com_media&view=file' . (!empty($tmpl) ? ('&tmpl=' . $tmpl) : ''),
'editViewUrl' => Uri::base() . 'index.php?option=com_media&view=file' . ($tmpl ? '&tmpl=' . $tmpl : ''),
'allowedUploadExtensions' => $params->get('upload_extensions', ''),
'maxUploadSizeMb' => $params->get('upload_maxsize', 10),
'providers' => (array) $this->providers,
Expand Down
Expand Up @@ -116,7 +116,7 @@ public function getItems()

// Get the database object and a new query object.
$query = $this->_db->getQuery(true)
->select('DISTINCT ' . $db->quoteName('position', 'value'))
->select('DISTINCT ' . $this->_db->quoteName('position', 'value'))
->from($this->_db->quoteName('#__modules'))
->where($this->_db->quoteName('client_id') . ' = :clientid')
->bind(':clientid', $clientId, ParameterType::INTEGER);
Expand Down
Expand Up @@ -41,10 +41,10 @@
</div>
</div>
<div class="form-group">
<label class="control-label" for="batch-password-reset_id">
<?php echo Text::_('COM_USERS_REQUIRE_PASSWORD_RESET'); ?>
</label>
<fieldset id="batch-password-reset_id">
<legend>
<?php echo Text::_('COM_USERS_REQUIRE_PASSWORD_RESET'); ?>
</legend>
<?php echo HTMLHelper::_('select.radiolist', $resetOptions, 'batch[reset_id]', '', 'value', 'text', ''); ?>
</fieldset>
</div>
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/com_cpanel.ini
Expand Up @@ -6,7 +6,7 @@
COM_CPANEL="Dashboard"
COM_CPANEL_ADD_DASHBOARD_MODULE="Add module to the dashboard"
COM_CPANEL_ADD_MODULE_MODAL_TITLE="Add Module"
COM_CPANEL_DASHBOARD_BASE_TITLE="Control Panel"
COM_CPANEL_DASHBOARD_BASE_TITLE="Home Dashboard"
COM_CPANEL_DASHBOARD_COMPONENTS_TITLE="Components Dashboard"
COM_CPANEL_DASHBOARD_CONTENT_TITLE="Content Dashboard"
COM_CPANEL_DASHBOARD_CONTENT_WORKFLOW_TITLE="Content Workflow Dashboard"
Expand Down Expand Up @@ -37,4 +37,4 @@ COM_CPANEL_UNPUBLISH_MODULE_ERROR="Error unpublishing the module"
COM_CPANEL_UNPUBLISH_MODULE_SUCCESS="Module unpublished"
COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="<p>Community resources are available for new users.</p><ul><li><a href=\"https://docs.joomla.org/Special:MyLanguage/Portal:Beginners\">Joomla! Beginners Guide</a></li><li><a href=\"https://forum.joomla.org/viewforum.php?f=706\">New to Joomla! Forum</a></li></ul>"
COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!"
COM_CPANEL_XML_DESCRIPTION="Control Panel component"
COM_CPANEL_XML_DESCRIPTION="Home Dashboard component"

0 comments on commit 2d6d591

Please sign in to comment.