Skip to content

Commit

Permalink
Merge branch '5.1-dev' into 5.1/modules/site/banners
Browse files Browse the repository at this point in the history
  • Loading branch information
LadySolveig committed Jan 24, 2024
2 parents 0c3ff13 + de23670 commit a770f05
Show file tree
Hide file tree
Showing 279 changed files with 5,410 additions and 2,855 deletions.
33 changes: 27 additions & 6 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ clone:

steps:
- name: setup
image: joomlaprojects/docker-images:php8.2
image: joomlaprojects/docker-images:php8.3
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/certs/* /certificates/

- name: composer
image: joomlaprojects/docker-images:php8.2
image: joomlaprojects/docker-images:php8.3
volumes:
- name: composer-cache
path: /tmp/composer-cache
Expand Down Expand Up @@ -63,6 +63,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php83-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php81-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
Expand All @@ -77,6 +84,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php83-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php81-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
Expand All @@ -91,6 +105,13 @@ steps:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: php83-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: scss-cs
depends_on: [ npm ]
image: node:current-alpine
Expand Down Expand Up @@ -145,7 +166,7 @@ steps:
- name: phpnext-system-mysql
depends_on:
- phpmax-system-mysql
image: joomlaprojects/docker-images:cypress8.2
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
Expand Down Expand Up @@ -184,7 +205,7 @@ steps:
- name: phpnext-system-postgres
depends_on:
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress8.2
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
Expand Down Expand Up @@ -333,7 +354,7 @@ steps:
- mkdir -p transfer
- date +%s > transfer/$MINORVERSION-time.txt
- git rev-parse origin/$MINORVERSION-dev > transfer/$MINORVERSION.txt
- php build/build.php --remote=origin/$MINORVERSION-dev --exclude-gzip --exclude-bzip2 --disable-patch-packages
- php build/build.php --remote=origin/$MINORVERSION-dev --exclude-gzip --disable-patch-packages
- mv build/tmp/packages/* transfer/

- name: upload
Expand Down Expand Up @@ -382,6 +403,6 @@ trigger:

---
kind: signature
hmac: 5814cadc441b90eec51da0aa32cd29ff1014c4d759841cc70063b5e9245d2b08
hmac: c1434b09300896f8627ccb11c92e97878caf7a303772db01a647dca53a92fa3f

...
49 changes: 0 additions & 49 deletions .github/workflows/cacert-update.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/create-translation-pull-request-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20

- name: Fetch latest cms changes
run: |
Expand All @@ -37,7 +37,7 @@ jobs:
git remote add upstream https://github.com/joomla/joomla-cms.git
git fetch upstream
git checkout --progress --force -B translation refs/remotes/origin/translation
git merge upstream/4.3-dev
git merge upstream/4.4-dev
- name: Fetch and extract translations
run: |
Expand Down Expand Up @@ -73,5 +73,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.3-dev
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "[4.x] Translation Update" | grep -v "No pull" || \
gh pr create --title "[4.x] Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.4-dev
77 changes: 77 additions & 0 deletions .github/workflows/create-translation-pull-request-v5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Create translation pull request

on:
push:
branches: [ translation ]

workflow_dispatch:

schedule:
# Run daily at 7:32
- cron: '32 7 * * *'

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
# Only run this action the translation-bot repository in the translation branch
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation5' }}

steps:
- uses: actions/checkout@v3
# We need the full depth to create / update the pull request against the main repo
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20

- name: Fetch latest cms changes
run: |
git config user.name Translation Bot
git config user.email release+translation-bot@joomla.org
git remote add upstream https://github.com/joomla/joomla-cms.git
git fetch upstream
git checkout --progress --force -B translation5 refs/remotes/origin/translation5
git merge upstream/5.0-dev
- name: Fetch and extract translations
run: |
cd ..
wget -nv "https://github.com/joomla/core-translations/archive/refs/heads/main.zip"
unzip main.zip
- name: Syncing directories
# We use a simple copy paste syntax here if needed customization for different directories
run: |
cd ..
SYNC_VERSION="v5"
SYNC_PATH="installation/language/"
echo ${SYNC_PATH}
rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERSION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH}
- name: Update static error pages
run: |
npm ci --ignore-scripts && node build/build.js --build-pages
- name: Create commit
continue-on-error: true
run: |
git config user.name Translation Bot
git config user.email release+translation-bot@joomla.org
git add .
git commit -m "Language update"
git push --force
- name: Create pull request
if: ${{ success() }}
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
run: |
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 5.0-dev
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
/**
* Field to load a list of all users that have logged actions
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
class UserlogtypeField extends ListField
{
/**
* The form field type.
*
* @var string
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
protected $type = 'UserLogType';

Expand All @@ -39,7 +39,7 @@ class UserlogtypeField extends ListField
*
* @return array The field option objects.
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public function getOptions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
$messageData['type'] = Text::_($messageData['type']);
}

// Remove links from the message template, if we should not generate links.
if (!$generateLinks) {
$message = preg_replace('/<a href=["\'].+?["\']>/', '', $message);
$message = str_replace('</a>', '', $message);
}

$linkMode = Factory::getApplication()->get('force_ssl', 0) >= 1 ? Route::TLS_FORCE : Route::TLS_IGNORE;

foreach ($messageData as $key => $value) {
Expand Down Expand Up @@ -324,6 +330,12 @@ public static function loadActionLogPluginsLanguage()
// Load plg_system_actionlogs too
$lang->load('plg_system_actionlogs', JPATH_ADMINISTRATOR);

// Load plg_system_privacyconsent too
$lang->load('plg_system_privacyconsent', JPATH_ADMINISTRATOR);

// Load plg_user_terms too
$lang->load('plg_user_terms', JPATH_ADMINISTRATOR);

// Load com_privacy too.
$lang->load('com_privacy', JPATH_ADMINISTRATOR);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ protected function sendNotificationEmails($messages, $username, $context)
$lang->load('com_actionlogs', JPATH_ADMINISTRATOR);
ActionlogsHelper::loadTranslationFiles($extension);
$temp = [];
$tempPlain = [];

foreach ($messages as $message) {
$m = [];
Expand All @@ -159,14 +160,23 @@ protected function sendNotificationEmails($messages, $username, $context)
$m['date'] = HTMLHelper::_('date', $message->log_date, 'Y-m-d H:i:s T', 'UTC');
$m['username'] = $username;
$temp[] = $m;

// copy replacement tags array and set non-HTML message.
$mPlain = array_merge([], $m);
$mPlain['message'] = ActionlogsHelper::getHumanReadableLogMessage($message, false);
$tempPlain[] = $mPlain;
}

$templateData = [
'messages' => $temp,
];
$templateDataPlain = [
'messages' => $tempPlain,
];

$mailer = new MailTemplate('com_actionlogs.notification', $app->getLanguage()->getTag());
$mailer->addTemplateData($templateData);
$mailer->addTemplateData($templateDataPlain, true);

foreach ($recipients as $recipient) {
$mailer->addRecipient($recipient);
Expand Down
20 changes: 10 additions & 10 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,10 @@ private function migrateLogRotationPlugin($data)
return;
}

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);

// Get the timeout, as configured in plg_system_logrotation
Expand Down Expand Up @@ -433,10 +433,10 @@ private function migrateSessionGCPlugin($data)
// Get the plugin parameters
$params = new Registry($data->params);

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Session GC',
Expand Down Expand Up @@ -478,10 +478,10 @@ private function migrateUpdatenotificationPlugin($data)
$params = new Registry($data->params);
$lastrun = (int) $params->get('lastrun', time());

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Update Notification',
Expand Down Expand Up @@ -2632,10 +2632,10 @@ private function migrateDeleteActionlogsConfiguration(): bool
return true;
}

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Delete Action Logs',
Expand Down Expand Up @@ -2701,10 +2701,10 @@ private function migratePrivacyconsentConfiguration(): bool
return true;
}

/** @var SchedulerComponent $component */
/** @var \Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent $component */
$component = Factory::getApplication()->bootComponent('com_scheduler');

/** @var TaskModel $model */
/** @var \Joomla\Component\Scheduler\Administrator\Model\TaskModel $model */
$model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]);
$task = [
'title' => 'Privacy Consent',
Expand Down

0 comments on commit a770f05

Please sign in to comment.