Skip to content

Commit

Permalink
Merge branch '4.2-dev' into 4.2-finder-customfields
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Feb 11, 2022
2 parents 550ca97 + 1cf32fc commit bc83e33
Show file tree
Hide file tree
Showing 73 changed files with 2,338 additions and 82 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -45,7 +45,7 @@ git clone git@github.com:joomla/joomla-cms.git
```bash
cd joomla-cms
```
- Go to the 4.1-dev branch:
- Go to the 4.2-dev branch:
```bash
git checkout 4.2-dev
```
Expand Down
Expand Up @@ -29,6 +29,7 @@
use Joomla\CMS\User\UserHelper;
use Joomla\CMS\Version;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

/**
Expand Down Expand Up @@ -364,13 +365,39 @@ public function download()
$updateInfo = $this->getUpdateInformation();
$packageURL = trim($updateInfo['object']->downloadurl->_data);
$sources = $updateInfo['object']->get('downloadSources', array());
$headers = get_headers($packageURL, 1);

// We have to manually follow the redirects here so we set the option to false.
$httpOptions = new Registry;
$httpOptions->set('follow_location', false);

try
{
$head = HttpFactory::getHttp($httpOptions)->head($packageURL);
}
catch (\RuntimeException $e)
{
// Passing false here -> download failed message
$response['basename'] = false;

return $response;
}

// Follow the Location headers until the actual download URL is known
while (isset($headers['Location']))
while (isset($head->headers['location']))
{
$packageURL = $headers['Location'];
$headers = get_headers($packageURL, 1);
$packageURL = (string) $head->headers['location'][0];

try
{
$head = HttpFactory::getHttp($httpOptions)->head($packageURL);
}
catch (\RuntimeException $e)
{
// Passing false here -> download failed message
$response['basename'] = false;

return $response;
}
}

// Remove protocol, path and query string from URL
Expand Down
Expand Up @@ -4,17 +4,27 @@
@dblclick="openPreview()"
@mouseleave="hideActions()"
>
<div class="media-browser-item-preview"
:title="item.name">
<div
class="media-browser-item-preview"
:title="item.name"
>
<div class="image-background">
<div
<img
v-if="getURL"
class="image-cropped"
:style="{ backgroundImage: getHashedURL }"
/>
:src="getURL"
:alt="altTag"
loading="lazy"
:width="width"
:height="height"
>
<span v-if="!getURL" class="icon-eye-slash image-placeholder" aria-hidden="true"></span>
</div>
</div>
<div class="media-browser-item-info"
:title="item.name">
<div
class="media-browser-item-info"
:title="item.name"
>
{{ item.name }} {{ item.filetype }}
</div>
<span
Expand All @@ -40,24 +50,37 @@ import { api } from '../../../app/Api.es6';
export default {
name: 'MediaBrowserItemImage',
// eslint-disable-next-line vue/require-prop-types
props: ['item', 'focused'],
props: {
item: { type: Object, required: true },
focused: { type: Boolean, required: true, default: false },
},
data() {
return {
showActions: false,
showActions: { type: Boolean, default: false },
};
},
computed: {
/* Get the hashed URL */
getHashedURL() {
if (this.item.adapter.startsWith('local-')) {
return `url(${this.item.thumb_path}?${api.mediaVersion})`;
getURL() {
if (!this.item.thumb_path) {
return '';
}
return `url(${this.item.thumb_path})`;
return this.item.thumb_path.split(Joomla.getOptions('system.paths').rootFull).length > 1
? `${this.item.thumb_path}?${api.mediaVersion}`
: `${this.item.thumb_path}`;
},
width() {
return this.item.width;
},
height() {
return this.item.height;
},
altTag() {
return this.item.name;
},
},
methods: {
/* Check if the item is a document to edit */
/* Check if the item is an image to edit */
canEdit() {
return ['jpg', 'jpeg', 'png'].includes(this.item.extension.toLowerCase());
},
Expand Down
Expand Up @@ -49,7 +49,7 @@ class CronField extends ListField
private const OPTIONS_RANGE = [
'minutes' => [0, 59],
'hours' => [0, 23],
'days_week' => [0, 6],
'days_week' => [1, 7],
'days_month' => [1, 31],
'months' => [1, 12],
];
Expand Down
Expand Up @@ -665,7 +665,7 @@ private function buildExecutionRules(array $executionRules): array
$buildExpression = sprintf($intervalStringMap[$intervalType], $interval);
}

if ($ruleClass === 'cron')
if ($ruleClass === 'cron-expression')
{
// ! custom matches are disabled in the form
$matches = $executionRules['cron-expression'];
Expand Down
12 changes: 12 additions & 0 deletions api/components/com_content/src/Controller/ArticlesController.php
Expand Up @@ -75,6 +75,18 @@ public function displayList()
$this->modelState->set('filter.language', $filter->clean($apiFilterInfo['language'], 'STRING'));
}

$apiListInfo = $this->input->get('list', [], 'array');

if (array_key_exists('ordering', $apiListInfo))
{
$this->modelState->set('list.ordering', $filter->clean($apiListInfo['ordering'], 'STRING'));
}

if (array_key_exists('direction', $apiListInfo))
{
$this->modelState->set('list.direction', $filter->clean($apiListInfo['direction'], 'STRING'));
}

return parent::displayList();
}

Expand Down
18 changes: 14 additions & 4 deletions build/media_source/com_media/scss/components/_media-browser.scss
Expand Up @@ -204,13 +204,23 @@
}

.image-cropped {
padding-bottom: 100%;
background-repeat: no-repeat;
background-position: center;
background-size: contain;
aspect-ratio: 1/1;
max-width: 100%;
height: auto;
object-fit: contain;
border-radius: $grid-item-border-radius;
}

.image-placeholder {
display: flex;
align-items: center;
justify-content: center;
aspect-ratio: 1/1;
max-width: 100%;
height: auto;
color: #9d9d9d;
}

.file-background, .folder-background {
padding-bottom: 100%;
background-color: hsl(var(--hue), 20%, 97%);
Expand Down
8 changes: 4 additions & 4 deletions components/com_privacy/src/Model/RequestModel.php
Expand Up @@ -88,7 +88,7 @@ public function createRequest($data)
return false;
}

$email = Factory::getUser()->email;
$data['email'] = Factory::getUser()->email;

// Search for an open information request matching the email and type
$db = $this->getDbo();
Expand All @@ -98,7 +98,7 @@ public function createRequest($data)
->where($db->quoteName('email') . ' = :email')
->where($db->quoteName('request_type') . ' = :requesttype')
->whereIn($db->quoteName('status'), [0, 1])
->bind(':email', $email)
->bind(':email', $data['email'])
->bind(':requesttype', $data['request_type']);

try
Expand Down Expand Up @@ -139,7 +139,7 @@ public function createRequest($data)

$messageModel->notifySuperUsers(
Text::_('COM_PRIVACY_ADMIN_NOTIFICATION_USER_CREATED_REQUEST_SUBJECT'),
Text::sprintf('COM_PRIVACY_ADMIN_NOTIFICATION_USER_CREATED_REQUEST_MESSAGE', $email)
Text::sprintf('COM_PRIVACY_ADMIN_NOTIFICATION_USER_CREATED_REQUEST_MESSAGE', $data['email'])
);

// The mailer can be set to either throw Exceptions or return boolean false, account for both
Expand Down Expand Up @@ -174,7 +174,7 @@ public function createRequest($data)
}

$mailer->addTemplateData($templateData);
$mailer->addRecipient($email);
$mailer->addRecipient($data['email']);

$mailer->send();

Expand Down

0 comments on commit bc83e33

Please sign in to comment.