Skip to content

Commit

Permalink
Merge branch '5.1-dev' into 5.1/plugins/webservices/events
Browse files Browse the repository at this point in the history
  • Loading branch information
heelc29 committed Nov 4, 2023
2 parents 4df444c + bb8e527 commit d7e3ad2
Show file tree
Hide file tree
Showing 57 changed files with 482 additions and 211 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ hosts:
openldap: 127.0.0.1

services:
- mysql
- iis

before_test:
# Run openldap docker image
- ps: docker pull bitnami/openldap:2.6.3
- ps: docker run --rm --name openldap --publish 1389:1389 --publish 1636:1636 -v ${pwd}\tests\certs:/certificates --env LDAP_ADMIN_USERNAME=admin --env LDAP_ADMIN_PASSWORD=adminpassword --env LDAP_USERS=customuser --env LDAP_PASSWORDS=custompassword --env LDAP_ENABLE_TLS=yes --env LDAP_TLS_CERT_FILE=/certificates/openldap.crt --env LDAP_TLS_KEY_FILE=/certificates/openldap.key --env LDAP_TLS_CA_FILE=/certificates/CA.crt --env BITNAMI_DEBUG=true --env LDAP_CONFIG_ADMIN_ENABLED=yes --env LDAP_CONFIG_ADMIN_USERNAME=admin --env LDAP_CONFIG_ADMIN_PASSWORD=configpassword -d bitnami/openldap:2.6.3
# Database setup for MySQL via PowerShell tools
- ps: Start-Service MySQL80
- >
"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -u root -p"Password12!" -e "CREATE DATABASE IF NOT EXISTS test_joomla;"
# Wait till slapd has started
- ps: |
$Counter=0
Expand Down
60 changes: 35 additions & 25 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,29 +286,39 @@ steps:
- name: packager
image: joomlaprojects/docker-images:packager
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
HTTP_ROOT: "https://ci.joomla.org/artifacts"
HTTP_ROOT: "https://artifacts.joomla.org/drone"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
commands:
- /bin/drone_prepare_package.sh

- name: upload
image: joomlaprojects/docker-images:packager
environment:
package_key:
from_secret: package_key
package_user:
from_secret: package_user
package_host:
from_secret: package_host
package_root:
from_secret: package_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh
volumes:
- name: reference
path: /reference
when:
repo:
- joomla/joomla-cms
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$package_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create package sftp host $package_host user $package_user port 22
- rclone copy ./upload/ package:$package_root/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/downloads/$DRONE_BUILD_NUMBER
- /bin/add_github_status.sh "Download" "Prebuilt packages are available for download." "https://artifacts.joomla.org/drone/${DRONE_REPO}/${DRONE_BRANCH}/${DRONE_PULL_REQUEST}/downloads/${DRONE_BUILD_NUMBER}"

trigger:
repo:
- joomla/joomla-cms

---
kind: pipeline
Expand All @@ -335,8 +345,8 @@ steps:
from_secret: nightly_user
nightly_host:
from_secret: nightly_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- mkdir -p ~/.ssh
Expand All @@ -349,15 +359,15 @@ steps:
- rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_$MINORVERSION.*"
- rclone delete nightly:/home/devj/public_html/cache/com_content/
- rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/
- /bin/notify
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK

- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- /bin/notify
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK
when:
status:
- failure
Expand All @@ -372,6 +382,6 @@ trigger:

---
kind: signature
hmac: 45b19b7430edc5ec922ef32c2f2dcb284c7cbf7ba55eb295ba4d877cee0fe5a4
hmac: 3cea0dbbf3e13e88b16369bbbbd85531791831bbc8f083fdae4928b3122fbf7c

...
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class ArticleField extends ModalSelectField
*/
public function setup(\SimpleXMLElement $element, $value, $group = null)
{
// Check if the value consist with id:alias, extract the id only
if ($value && str_contains($value, ':')) {
[$id] = explode(':', $value, 2);
$value = (int) $id;
}

$result = parent::setup($element, $value, $group);

if (!$result) {
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_fields/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
name="searchindex"
type="list"
label="COM_FIELDS_FIELD_SEARCHINDEX_LABEL"
description="COM_FIELDS_FIELD_SEARCHINDEX_DESC"
default="0"
validate="options"
>
Expand Down
10 changes: 6 additions & 4 deletions administrator/components/com_fields/src/Plugin/FieldsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form
$node->setAttribute('showon', $showon_attribute);
}

if ($layout = $field->params->get('form_layout')) {
$node->setAttribute('layout', $layout);
}

if ($field->default_value !== '') {
$defaultNode = $node->appendChild(new \DOMElement('default'));
$defaultNode->appendChild(new \DOMCdataSection($field->default_value));
Expand All @@ -282,6 +278,12 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form
$params = clone $this->params;
$params->merge($field->fieldparams);

$layout = $field->params->get('form_layout', $this->params->get('form_layout', ''));

if ($layout) {
$node->setAttribute('layout', $layout);
}

// Set the specific field parameters
foreach ($params->toArray() as $key => $param) {
if (\is_array($param)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,27 +431,27 @@ protected static function getUpdateSitesInformation(bool $onlyEnabled): array
->select(
$db->quoteName(
[
's.update_site_id',
's.enabled',
's.extra_query',
'e.extension_id',
'e.type',
'e.element',
'e.folder',
'e.client_id',
'e.manifest_cache',
],
's.update_site_id',
's.enabled',
's.extra_query',
'e.extension_id',
'e.type',
'e.element',
'e.folder',
'e.client_id',
'e.manifest_cache',
],
[
'update_site_id',
'enabled',
'extra_query',
'extension_id',
'type',
'element',
'folder',
'client_id',
'manifest_cache',
]
'update_site_id',
'enabled',
'extra_query',
'extension_id',
'type',
'element',
'folder',
'client_id',
'manifest_cache',
]
)
)
->from($db->quoteName('#__update_sites', 's'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ protected function getListQuery()
->bind(':extensionid', $extensionId, ParameterType::INTEGER);
} else {
$eid = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id;
$query->where($db->quoteName('u.extension_id') . ' != 0')
->where($db->quoteName('u.extension_id') . ' != :eid')
$query->where($db->quoteName('u.extension_id') . ' != :eid')
->bind(':eid', $eid, ParameterType::INTEGER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ private function checkCompatibility($updateFileUrl, $joomlaTargetVersion)
*/
protected function translateExtensionName(&$item)
{
// @todo: Cleanup duplicated code. from com_installer/models/extension.php
// @todo: Cleanup duplicated code. from com_installer/src/Model/InstallerModel.php
$lang = Factory::getLanguage();
$path = $item->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ class HtmlView extends BaseHtmlView
*/
protected $messagePrefix = '';

/**
* A special text used for the emptystate layout to explain why there is no download
*
* @var string The message
*
* @since 4.4.0
*/
protected $reasonNoDownload = '';

/**
* List of non core critical plugins
*
Expand Down Expand Up @@ -190,7 +199,8 @@ public function display($tpl = null)
} else {
// No download available
if ($hasUpdate) {
$this->messagePrefix = '_NODOWNLOAD';
$this->messagePrefix = '_NODOWNLOAD';
$this->reasonNoDownload = 'COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_REASON';
}

$this->setLayout('noupdate');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

$displayData = [
'textPrefix' => 'COM_JOOMLAUPDATE' . $this->messagePrefix,
'content' => Text::sprintf($this->langKey, $this->updateSourceKey),
'content' => Text::_($this->reasonNoDownload) . Text::sprintf($this->langKey, $this->updateSourceKey),
'formURL' => 'index.php?option=com_joomlaupdate&view=joomlaupdate',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Updating_from_an_existing_version',
'icon' => 'icon-loop joomlaupdate',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
@click="onClick"
>
<td
v-if="item.mime_type === 'image/svg+xml' && getURL()"
>
<img
:src="getURL()"
:width="item.width"
:height="item.height"
alt=""
style="width:100%;height:auto"
@load="setSize"
>
</td>
<td
v-else
class="type"
:data-type="item.extension"
/>
Expand All @@ -31,6 +44,7 @@
</template>

<script>
import api from '../../../app/Api.es6';
import * as types from '../../../store/mutation-types.es6';
import navigable from '../../../mixins/navigable.es6';
Expand Down Expand Up @@ -67,6 +81,30 @@ export default {
},
methods: {
getURL() {
if (!this.item.thumb_path) {
return '';
}
return this.item.thumb_path.split(Joomla.getOptions('system.paths').rootFull).length > 1
? `${this.item.thumb_path}?${this.item.modified_date ? new Date(this.item.modified_date).valueOf() : api.mediaVersion}`
: `${this.item.thumb_path}`;
},
width() {
return this.item.naturalWidth ? this.item.naturalWidth : 300;
},
height() {
return this.item.naturalHeight ? this.item.naturalHeight : 150;
},
setSize(event) {
if (this.item.mime_type === 'image/svg+xml') {
const image = event.target;
// Update the item properties
this.$store.dispatch('updateItemProperties', { item: this.item, width: image.naturalWidth ? image.naturalWidth : 300, height: image.naturalHeight ? image.naturalHeight : 150 });
// @TODO Remove the fallback size (300x150) when https://bugzilla.mozilla.org/show_bug.cgi?id=1328124 is fixed
// Also https://github.com/whatwg/html/issues/3510
}
},
/* Handle the on row double click event */
onDblClick() {
if (this.isDir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ public function __set($name, $value)
*/
public function setup(\SimpleXMLElement $element, $value, $group = null)
{
// Check if the value consist with id:alias, extract the id only
if ($value && str_contains($value, ':')) {
[$id] = explode(':', $value, 2);
$value = (int) $id;
}

$return = parent::setup($element, $value, $group);

if (!$return) {
Expand Down

0 comments on commit d7e3ad2

Please sign in to comment.