Skip to content

Commit a4854f3

Browse files
committed
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into 4.1-dev
2 parents bc896d2 + ab2b826 commit a4854f3

File tree

129 files changed

+8768
-681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+8768
-681
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Create translation pull request
2+
3+
on:
4+
push:
5+
branches: [ translation ]
6+
7+
workflow_dispatch:
8+
9+
schedule:
10+
# Run daily at 7:26
11+
- cron: '26 7 * * *'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
# Only run this action the translation-bot repository in the translation branch
17+
if: ${{ github.repository == 'joomla-translation-bot/joomla-cms' && github.ref == 'refs/heads/translation' }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
# We need the full depth to create / update the pull request against the main repo
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Fetch latest cms changes
26+
run: |
27+
git config user.name Translation Bot
28+
git config user.email [email protected]
29+
git remote add upstream https://github.com/joomla/joomla-cms.git
30+
git fetch upstream
31+
git checkout --progress --force -B translation refs/remotes/origin/translation
32+
git rebase upstream/4.0-dev
33+
34+
- name: Fetch and extract translations
35+
run: |
36+
cd ..
37+
wget -nv "https://github.com/joomla/core-translations/archive/refs/heads/main.zip"
38+
unzip main.zip
39+
40+
- name: Syncing directories
41+
# We use a simple copy paste syntax here if needed customization for different directories
42+
run: |
43+
cd ..
44+
SYNC_VERION="v4"
45+
46+
SYNC_PATH="installation/language/"
47+
echo ${SYNC_PATH}
48+
rsync -i -rptgo --checksum --ignore-times --delete --exclude="*en-GB*" core-translations-main/joomla_${SYNC_VERION}/translations/core/${SYNC_PATH} joomla-cms/${SYNC_PATH}
49+
50+
- name: Create commit
51+
run: |
52+
git config user.name Translation Bot
53+
git config user.email [email protected]
54+
git add .
55+
git commit -m "Language update"
56+
git push --force
57+
58+
- name: Create pull request
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
61+
run: |
62+
gh pr list -R joomla/joomla-cms --state open --author joomla-translation-bot -S "Translation Update" | grep -v "No pull" || \
63+
gh pr create --title "Translation Update" --body "Automatically created pull request based on core-translation repository changes" -R joomla/joomla-cms --base 4.0-dev

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
/administrator/logs
1515
/cache
1616
/installation/cache
17-
/installation/sessions
1817
/tmp
1918
/configuration.php
2019
/.htaccess

administrator/components/com_admin/script.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ protected function updateManifestCaches()
567567
{
568568
$extensions = ExtensionHelper::getCoreExtensions();
569569

570+
// If we have the search package around, it may not have a manifest cache entry after upgrades from 3.x, so add it to the list
571+
if (File::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml'))
572+
{
573+
$extensions[] = array('package', 'pkg_search', '', 0);
574+
}
575+
570576
// Attempt to refresh manifest caches
571577
$db = Factory::getDbo();
572578
$query = $db->getQuery(true)
@@ -7386,6 +7392,18 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
73867392

73877393
$this->fixFilenameCasing();
73887394

7395+
/*
7396+
* Needed for updates from 3.10
7397+
* If com_search doesn't exist then assume we can delete the search package manifest (included in the update packages)
7398+
* We deliberately check for the presence of the files in case people have previously uninstalled their search extension
7399+
* but an update has put the files back. In that case it exists even if they don't believe in it!
7400+
*/
7401+
if (!File::exists(JPATH_ROOT . '/administrator/components/com_search/search.php')
7402+
&& File::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml'))
7403+
{
7404+
File::delete(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml');
7405+
}
7406+
73897407
if ($suppressOutput === false && \count($status['folders_errors']))
73907408
{
73917409
echo implode('<br>', $status['folders_errors']);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--
2+
-- Fix wrong asset name for com_content basic workflow stage if a new asset with the right
3+
-- name hasn't been created yet when saving the workflow stage in backend in past.
4+
--
5+
UPDATE `#__assets`
6+
SET `name` = 'com_content.stage.1'
7+
WHERE `name` = 'com_content.state.1'
8+
AND (SELECT c.`count` FROM (SELECT COUNT(b.`id`) AS `count` FROM `#__assets` b WHERE b.`name` = 'com_content.stage.1') AS c) = 0;
9+
10+
--
11+
-- Fix wrong asset titles for workflow transitions
12+
--
13+
UPDATE `#__assets` SET `title` = 'Unpublish' WHERE `name` = 'com_content.transition.1' AND `title` = 'Publish';
14+
UPDATE `#__assets` SET `title` = 'Publish' WHERE `name` = 'com_content.transition.2' AND `title` = 'Unpublish';
15+
UPDATE `#__assets` SET `title` = 'Trash' WHERE `name` = 'com_content.transition.3' AND `title` = 'Archive';
16+
UPDATE `#__assets` SET `title` = 'Archive' WHERE `name` = 'com_content.transition.4' AND `title` = 'Trash';
17+
18+
--
19+
-- Set asset ID of com_content basic workflow stage to the right value if not already set.
20+
-- The right value is either the asset fixed with the first update statement at the top
21+
-- of this file or a new asset which has been created yet when saving the workflow stage
22+
-- in backend in past.
23+
--
24+
UPDATE `#__workflow_stages` s
25+
INNER JOIN (SELECT `name`, MAX(`id`) AS `id` FROM `#__assets` GROUP BY `name`) AS a ON a.`name` = CONCAT('com_content.stage.', s.`id`)
26+
SET s.`asset_id` = a.`id`
27+
WHERE s.`id` = 1
28+
AND s.`asset_id` = 0;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
2+
('search', 'package', 'pkg_search', '', 0, 1, 1, 0, '', '', '', 0, NULL, 0, 0);
3+
4+
UPDATE `#__extensions` a
5+
CROSS JOIN (SELECT `extension_id` FROM `#__extensions` WHERE `type`='package' AND `element`='pkg_search') AS b
6+
SET a.`package_id` = b.`extension_id`
7+
WHERE (`type` = 'component' AND `element` = 'com_search')
8+
OR (`type` = 'module' AND `element` = 'mod_search' AND `client_id` = 0)
9+
OR (`type` = 'plugin' AND `element` IN ('categories', 'contacts', 'content', 'newsfeeds', 'tags') AND `folder` = 'search');
10+
11+
INSERT INTO `#__update_sites` (`name`, `type`, `location`, `enabled`) VALUES
12+
('Search Update Site', 'extension', 'https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml', 1);
13+
14+
INSERT INTO `#__update_sites_extensions` (`update_site_id`, `extension_id`) VALUES
15+
((SELECT `update_site_id` FROM `#__update_sites` WHERE `name` = 'Search Update Site'), (SELECT `extension_id` FROM `#__extensions` WHERE `element` = 'pkg_search' AND `type` = 'package'));
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--
2+
-- Fix wrong asset name for com_content basic workflow stage if a new asset with the right
3+
-- name hasn't been created yet when saving the workflow stage in backend in past.
4+
--
5+
UPDATE "#__assets"
6+
SET "name" = 'com_content.stage.1'
7+
WHERE "name" = 'com_content.state.1'
8+
AND (SELECT c."count" FROM (SELECT COUNT(b."id") AS "count" FROM "#__assets" b WHERE b."name" = 'com_content.stage.1') AS c) = 0;
9+
10+
--
11+
-- Fix wrong asset titles for workflow transitions
12+
--
13+
UPDATE "#__assets" SET "title" = 'Unpublish' WHERE "name" = 'com_content.transition.1' AND "title" = 'Publish';
14+
UPDATE "#__assets" SET "title" = 'Publish' WHERE "name" = 'com_content.transition.2' AND "title" = 'Unpublish';
15+
UPDATE "#__assets" SET "title" = 'Trash' WHERE "name" = 'com_content.transition.3' AND "title" = 'Archive';
16+
UPDATE "#__assets" SET "title" = 'Archive' WHERE "name" = 'com_content.transition.4' AND "title" = 'Trash';
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
2+
('search', 'package', 'pkg_search', '', 0, 1, 1, 0, '', '', '', 0, NULL, 0, 0);
3+
4+
UPDATE "#__extensions"
5+
SET "package_id" = b."extension_id"
6+
FROM (SELECT "extension_id" FROM "#__extensions" WHERE "type"='package' AND "element"='pkg_search') AS b
7+
WHERE ("type" = 'component' AND "element" = 'com_search')
8+
OR ("type" = 'module' AND "element" = 'mod_search' AND "client_id" = 0)
9+
OR ("type" = 'plugin' AND "element" IN ('categories', 'contacts', 'content', 'newsfeeds', 'tags') AND "folder" = 'search');
10+
11+
INSERT INTO "#__update_sites" ("name", "type", "location", "enabled") VALUES
12+
('Search Update Site', 'extension', 'https://raw.githubusercontent.com/joomla-extensions/search/main/manifest.xml', 1);
13+
14+
INSERT INTO "#__update_sites_extensions" ("update_site_id", "extension_id") VALUES
15+
((SELECT "update_site_id" FROM "#__update_sites" WHERE "name" = 'Search Update Site'), (SELECT "extension_id" FROM "#__extensions" WHERE "element" = 'pkg_search' AND "type" = 'package'));

administrator/components/com_admin/src/Model/SysinfoModel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ public function getDirectory(bool $public = false): array
535535
$cparams = ComponentHelper::getParams('com_media');
536536

537537
$this->addDirectory('administrator/components', JPATH_ADMINISTRATOR . '/components');
538+
$this->addDirectory('administrator/components/com_joomlaupdate', JPATH_ADMINISTRATOR . '/components/com_joomlaupdate');
538539
$this->addDirectory('administrator/language', JPATH_ADMINISTRATOR . '/language');
539540

540541
// List all admin languages

administrator/components/com_categories/src/View/Categories/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected function addToolbar()
179179
$title = Text::_($component_title_key);
180180
}
181181
elseif ($lang->hasKey($component_section_key = strtoupper($component . ($section ? "_$section" : ''))))
182-
// Else if the component section string exits, let's use it
182+
// Else if the component section string exists, let's use it.
183183
{
184184
$title = Text::sprintf('COM_CATEGORIES_CATEGORIES_TITLE', $this->escape(Text::_($component_section_key)));
185185
}

administrator/components/com_categories/src/View/Category/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ protected function addToolbar()
161161
{
162162
$title = Text::_($component_title_key);
163163
}
164-
// Else if the component section string exits, let's use it
164+
// Else if the component section string exists, let's use it.
165165
elseif ($lang->hasKey($component_section_key = $component . ($section ? "_$section" : '')))
166166
{
167167
$title = Text::sprintf('COM_CATEGORIES_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT')

0 commit comments

Comments
 (0)