Skip to content

Commit 1c93e5b

Browse files
committed
Merge branch 'main' into next
2 parents d7a095d + 68cb9ec commit 1c93e5b

File tree

10 files changed

+140
-23
lines changed

10 files changed

+140
-23
lines changed

.all-contributorsrc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,25 @@
13821382
"contributions": [
13831383
"code"
13841384
]
1385-
}
1385+
},
1386+
{
1387+
"login": "gorbunovav",
1388+
"name": "Andrey Gorbunov",
1389+
"avatar_url": "https://avatars.githubusercontent.com/u/2665015?v=4",
1390+
"profile": "https://github.com/gorbunovav",
1391+
"contributions": [
1392+
"code"
1393+
]
1394+
},
1395+
{
1396+
"login": "Tomasz-Silpion",
1397+
"name": "Tomasz Gregorczyk",
1398+
"avatar_url": "https://avatars.githubusercontent.com/u/5328659?v=4",
1399+
"profile": "https://github.com/Tomasz-Silpion",
1400+
"contributions": [
1401+
"code"
1402+
]
1403+
},
13861404
],
13871405
"contributorsPerLine": 7
13881406
}

.github/workflows/check-files.yml

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ jobs:
4141
name: Changed
4242
runs-on: [ubuntu-latest]
4343
outputs:
44-
composer: ${{ steps.all.outputs.composer }}
45-
php: ${{ steps.all.outputs.php }}
46-
xml: ${{ steps.all.outputs.xml }}
47-
workflow: ${{ steps.all.outputs.workflow }}
48-
phpcs: ${{ steps.all.outputs.phpcs }}
49-
php-cs-fixer: ${{ steps.all.outputs.php-cs-fixer }}
50-
phpstan: ${{ steps.all.outputs.phpstan }}
51-
phpunit-test: ${{ steps.all.outputs.phpunit-test }}
52-
phpunit: ${{ steps.all.outputs.phpunit }}
53-
sonar: ${{ steps.all.outputs.sonar }}
44+
composer: ${{ steps.changes-composer.outputs.composer }}
45+
php: ${{ steps.changes-php.outputs.php }}
46+
xml: ${{ steps.changes-xml.outputs.xml }}
47+
workflow: ${{ steps.changes-workflow.outputs.workflow }}
48+
phpcs: ${{ steps.changes-phpcs.outputs.phpcs }}
49+
php-cs-fixer: ${{ steps.changes-php-cs-fixer.outputs.php-cs-fixer }}
50+
phpstan: ${{ steps.changes-phpstan.outputs.phpstan }}
51+
phpunit-test: ${{ steps.changes-phpunit-test.outputs.phpunit-test }}
52+
phpunit: ${{ steps.changes-phpunit.outputs.phpunit }}
53+
sonar: ${{ steps.changes-sonar.outputs.sonar }}
5454

5555
steps:
5656
- name: Checkout code
@@ -86,8 +86,8 @@ jobs:
8686
dev/phpunit*
8787
dev/sonar*
8888
89-
- name: Run step if any file(s) changed
90-
id: all
89+
- name: Check if composer files changed
90+
id: changes-composer
9191
if: steps.changed-files-specific.outputs.any_modified == 'true'
9292
run: |
9393
echo "One or more files have changed."
@@ -96,38 +96,74 @@ jobs:
9696
echo "$count Composer file(s) changed"
9797
echo "composer=$count" >> $GITHUB_OUTPUT
9898
99+
- name: Check if PHP files changed
100+
id: changes-php
101+
if: steps.changed-files-specific.outputs.any_modified == 'true'
102+
run: |
99103
count="$(grep -oE "*.php" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
100104
echo "$count PHP file(s) changed"
101105
echo "php=$count" >> $GITHUB_OUTPUT
102106
107+
- name: Check if XML files changed
108+
id: changes-xml
109+
if: steps.changed-files-specific.outputs.any_modified == 'true'
110+
run: |
103111
count="$(grep -oE "*.xml" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
104112
echo "$count XML file(s) changed"
105113
echo "xml=$count" >> $GITHUB_OUTPUT
106114
115+
- name: Check if Workflow files changed
116+
id: changes-workflow
117+
if: steps.changed-files-specific.outputs.any_modified == 'true'
118+
run: |
107119
count="$(grep -oE ".github/workflows/**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
108120
echo "$count Workflow file(s) changed"
109121
echo "workflow=$count" >> $GITHUB_OUTPUT
110122
123+
- name: Check if PHPCS test files changed
124+
id: changes-phpcs
125+
if: steps.changed-files-specific.outputs.any_modified == 'true'
126+
run: |
111127
count="$(grep -oE "**phpcs**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
112128
echo "$count PHPCS file(s) changed"
113129
echo "phpcs=$count" >> $GITHUB_OUTPUT
114130
131+
- name: Check if PHP-CS-Fixer files changed
132+
id: changes-php-cs-fixer
133+
if: steps.changed-files-specific.outputs.any_modified == 'true'
134+
run: |
115135
count="$(grep -oE "**php-cs-fixer**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
116136
echo "$count PHP-CS-Fixer file(s) changed"
117137
echo "php-cs-fixer=$count" >> $GITHUB_OUTPUT
118138
139+
- name: Check if PHPStan files changed
140+
id: changes-phpstan
141+
if: steps.changed-files-specific.outputs.any_modified == 'true'
142+
run: |
119143
count="$(grep -oE "**phpstan**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
120144
echo "$count PHPStan file(s) changed"
121145
echo "phpstan=$count" >> $GITHUB_OUTPUT
122146
147+
- name: Check if PHPUnit test files changed
148+
id: changes-phpunit-test
149+
if: steps.changed-files-specific.outputs.any_modified == 'true'
150+
run: |
123151
count="$(grep -oE "dev/tests/" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
124152
echo "$count UnitTest test file(s) changed"
125153
echo "phpunit-test=$count" >> $GITHUB_OUTPUT
126154
155+
- name: Check if PHPUnit files changed
156+
id: changes-phpunit
157+
if: steps.changed-files-specific.outputs.any_modified == 'true'
158+
run: |
127159
count="$(grep -oE "dev/phpunit*" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
128-
echo "$count UnitTest file(s) changed"
160+
echo "$count PHPUnit file(s) changed"
129161
echo "phpunit=$count" >> $GITHUB_OUTPUT
130162
163+
- name: Check if Sonar files changed
164+
id: changes-sonar
165+
if: steps.changed-files-specific.outputs.any_modified == 'true'
166+
run: |
131167
count="$(grep -oE "dev/sonar*" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
132168
echo "$count Sonar file(s) changed"
133169
echo "sonar=$count" >> $GITHUB_OUTPUT

.htaccess

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,34 @@
4040

4141
</IfModule>
4242

43+
############################################
44+
## php8 settings
45+
46+
<IfModule mod_php.c>
47+
48+
############################################
49+
## adjust max execution time
50+
51+
php_value max_execution_time 18000
52+
53+
############################################
54+
## disable automatic session start
55+
## before autoload was initialized
56+
57+
php_flag session.auto_start off
58+
59+
############################################
60+
## enable resulting html compression
61+
62+
#php_flag zlib.output_compression on
63+
64+
###########################################
65+
# disable user agent verification to not break multiple image upload
66+
67+
php_flag suhosin.session.cryptua off
68+
69+
</IfModule>
70+
4371
<IfModule mod_security.c>
4472
###########################################
4573
# disable POST processing to not break multiple image upload

app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/Admin/TokenController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ protected function _isAllowed()
155155
{
156156
/** @var Mage_Admin_Model_Session $session */
157157
$session = Mage::getSingleton('admin/session');
158-
return $session->isAllowed('system/acl/admin_token');
158+
return $session->isAllowed('system/api/oauth_admin_token');
159159
}
160160
}

app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizedTokensController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected function _isAllowed()
149149
{
150150
/** @var Mage_Admin_Model_Session $session */
151151
$session = Mage::getSingleton('admin/session');
152-
return $session->isAllowed('system/oauth/authorizedTokens');
152+
return $session->isAllowed('system/api/oauth_authorized_tokens');
153153
}
154154

155155
/**

app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/ConsumerController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ protected function _isAllowed()
240240
}
241241
/** @var Mage_Admin_Model_Session $session */
242242
$session = Mage::getSingleton('admin/session');
243-
return $session->isAllowed('system/oauth/consumer' . $action);
243+
return $session->isAllowed('system/api/oauth_consumer' . $action);
244244
}
245245

246246
/**
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* OpenMage
4+
*
5+
* This source file is subject to the Open Software License (OSL 3.0)
6+
* that is bundled with this package in the file LICENSE.txt.
7+
* It is also available at https://opensource.org/license/osl-3-0-php
8+
*
9+
* @category Mage
10+
* @package Mage_Admin
11+
* @copyright Copyright (c) 2023 The OpenMage Contributors (https://www.openmage.org)
12+
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
13+
*/
14+
15+
/** @var Mage_Core_Model_Resource_Setup $installer */
16+
$installer = $this;
17+
$installer->startSetup();
18+
19+
$table = $installer->getTable('admin/rule');
20+
$resourceIds = [
21+
'admin/system/api/consumer' => 'admin/system/api/oauth_consumer',
22+
'admin/system/api/consumer/delete' => 'admin/system/api/oauth_consumer/delete',
23+
'admin/system/api/consumer/edit' => 'admin/system/api/oauth_consumer/edit',
24+
'admin/system/api/authorizedTokens' => 'admin/system/api/oauth_authorized_tokens'
25+
];
26+
27+
foreach ($resourceIds as $oldId => $newId) {
28+
$installer->getConnection()->update(
29+
$table,
30+
['resource_id' => $newId],
31+
['resource_id = ?' => $oldId]
32+
);
33+
}
34+
35+
$installer->endSetup();

app/code/core/Mage/Oauth/etc/adminhtml.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<children>
2424
<api>
2525
<children>
26-
<consumer translate="title" module="oauth">
26+
<oauth_consumer translate="title" module="oauth">
2727
<title>OAuth Consumers</title>
2828
<sort_order>20</sort_order>
2929
<children>
@@ -36,11 +36,11 @@
3636
<sort_order>40</sort_order>
3737
</delete>
3838
</children>
39-
</consumer>
40-
<authorizedTokens translate="title" module="oauth">
39+
</oauth_consumer>
40+
<oauth_authorized_tokens translate="title" module="oauth">
4141
<title>OAuth Authorized Tokens</title>
4242
<sort_order>30</sort_order>
43-
</authorizedTokens>
43+
</oauth_authorized_tokens>
4444
<oauth_admin_token translate="title" module="oauth">
4545
<title>OAuth Admin My Apps</title>
4646
<sort_order>40</sort_order>

app/code/core/Mage/Oauth/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<config>
1818
<modules>
1919
<Mage_Oauth>
20-
<version>1.0.0.0</version>
20+
<version>1.0.0.1</version>
2121
</Mage_Oauth>
2222
</modules>
2323
<global>

lib/Varien/Data/Collection/Db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function getSelectCountSql()
241241
$countSelect->columns('COUNT(*)');
242242

243243
// Simple optimization - remove all joins if there are no where clauses using joined tables and all joins are left joins
244-
$leftJoins = array_filter($countSelect->getPart(Zend_Db_Select::FROM), function($table) {
244+
$leftJoins = array_filter($countSelect->getPart(Zend_Db_Select::FROM), function ($table) {
245245
return ($table['joinType'] == Zend_Db_Select::LEFT_JOIN || $table['joinType'] == Zend_Db_Select::FROM);
246246
});
247247
if (count($leftJoins) == count($countSelect->getPart(Zend_Db_Select::FROM))) {

0 commit comments

Comments
 (0)