Skip to content

Commit 13523bc

Browse files
authored
Merge branch 'main' into phpunit-pre-symfony
2 parents 3b72f4a + 8b8a054 commit 13523bc

File tree

127 files changed

+956
-763
lines changed

Some content is hidden

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

127 files changed

+956
-763
lines changed

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We will keep the details of your security vulnerability report private and only
1616

1717
To report a vulnerability, please *DO NOT* open a public Issue or Pull Request.
1818

19-
Please email your security vulnerability report to security@openmage.org along with your Github user name so that once we create a security advisory you may be added to it as a collaborator for further review.
19+
Please email your security vulnerability report to security@openmage.org along with your GitHub username so that once we create a security advisory you may be added to it as a collaborator for further review.
2020

2121
We will review the advisory and work with you to find a suitable solution. We will publicly disclose the vulnerability once a patch is prepared and our community and partners have an easy path forward to apply the patch promptly. We will be sure to give you credit for the vulnerability discovery unless you request otherwise.
2222

.github/spellcheck-usernames.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
addison
2+
bucha
3+
colinmollenhour
4+
fballiano
5+
Flyingmana
6+
kiatng
7+
robertrogge
8+
sreichel

.github/spellcheck-wordlist.txt

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
ACL
2+
ActionScript
3+
bool
4+
Braintree
5+
Browsersync
6+
Captcha
7+
CLI
8+
Cloudflare
9+
CMS
10+
Cron
11+
CVE
12+
CodeQL
13+
DevOps
14+
DDEV
15+
DNS
16+
DocBlock
17+
EAV
18+
Emmet
19+
FireGento
20+
FPC
21+
Gitpod
22+
HiPay
23+
Homebrew
24+
HMAC
25+
ImageMagick
26+
IntelliSense
27+
jQuery
28+
JS
29+
JSON
30+
LTS
31+
macOS
32+
Magento
33+
magerun
34+
Mailpit
35+
mkcert
36+
MkDocs
37+
Matomo
38+
MTF
39+
nginx
40+
npm
41+
OAuth
42+
OpenMage
43+
OpenNode
44+
PageSpeed
45+
PHPCompatibility
46+
PHPCS
47+
PHPMD
48+
phpMyAdmin
49+
PHPStan
50+
PhpStorm
51+
PHPUnit
52+
PLAINTEXT
53+
RCE
54+
reCaptcha
55+
Redis
56+
RPC
57+
RSS
58+
RWD
59+
SCSS
60+
SHA
61+
SMTP
62+
SSL
63+
TinyMCE
64+
toc
65+
URI
66+
Varien
67+
VMware
68+
WAMP
69+
WebP
70+
WSDL
71+
WSL
72+
XAMPP
73+
Xdebug
74+
XSS
75+
Zend
76+
ZF
77+

.github/spellcheck.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
matrix:
2+
- name: Markdown
3+
expect_match: false
4+
apsell:
5+
mode: en
6+
dictionary:
7+
wordlists:
8+
- .github/spellcheck-usernames.txt
9+
- .github/spellcheck-wordlist.txt
10+
output: wordlist.dic
11+
encoding: utf-8
12+
pipeline:
13+
- pyspelling.filters.markdown:
14+
markdown_extensions:
15+
- markdown.extensions.extra:
16+
- pyspelling.filters.html:
17+
comments: false
18+
attributes:
19+
- alt
20+
ignores:
21+
- ':matches(code, pre)'
22+
- ':matches(.magiclink)'
23+
- ':matches(.events-list-table + table)'
24+
- 'a'
25+
- 'code'
26+
- 'pre'
27+
- 'blockquote'
28+
sources:
29+
- 'docs/**/*.md'

.github/workflows/check-files.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ on:
3939
phpunit:
4040
description: "Count changed PHPUnit files"
4141
value: ${{ jobs.check.outputs.phpunit }}
42+
markdown:
43+
description: "Count changed markdown files"
44+
value: ${{ jobs.check.outputs.markdown }}
4245
cypress:
4346
description: "Count changed Cypress files"
4447
value: ${{ jobs.check.outputs.cypress }}
@@ -52,6 +55,7 @@ jobs:
5255
outputs:
5356
composer: ${{ steps.changes-composer.outputs.composer }}
5457
js: ${{ steps.changes-js.outputs.js }}
58+
markdown: ${{ steps.changes-php.outputs.markdown }}
5559
php: ${{ steps.changes-php.outputs.php }}
5660
phtml: ${{ steps.all.outputs.phtml }}
5761
xml: ${{ steps.changes-xml.outputs.xml }}
@@ -88,6 +92,7 @@ jobs:
8892
files: |
8993
composer.*
9094
*.php
95+
**/*.md
9196
**/*.php
9297
**/*.phtml
9398
**/*.xml
@@ -199,6 +204,14 @@ jobs:
199204
echo "$count PHPUnit file(s) changed"
200205
echo "phpunit=$count" >> $GITHUB_OUTPUT
201206
207+
- name: Check if Markdown files changed
208+
id: changes-markdown
209+
if: steps.changed-files-specific.outputs.any_modified == 'true'
210+
run: |
211+
count="$(grep -oE "*.md" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
212+
echo "$count Markdown file(s) changed"
213+
echo "markdown=$count" >> $GITHUB_OUTPUT
214+
202215
- name: Check if Cypress files changed
203216
id: changes-cypress
204217
if: steps.changed-files-specific.outputs.any_modified == 'true'

.github/workflows/cypress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
webserver: ['apache-fpm', 'nginx-fpm']
1515

1616
steps:
17-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v4
1818
- name: Setup DDEV
1919
uses: ddev/github-action-setup-ddev@v1
2020
with:

.github/workflows/spellcheck.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Markdown
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
spellcheck:
9+
name: Markdown
10+
runs-on: [ubuntu-latest]
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Check Spelling
16+
uses: rojopolis/spellcheck-github-actions@0.47.0
17+
with:
18+
config_path: .github/spellcheck.yml
19+
task_name: Markdown

.github/workflows/workflow.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- '**.php'
1010
- '**.phtml'
1111
- '**.js'
12+
- '**.md'
1213
- '**.xml'
1314
- '.php-cs-fixer.dist.php'
1415
- '.phpcs.dist.xml'
@@ -25,6 +26,7 @@ on:
2526
- '**.php'
2627
- '**.phtml'
2728
- '**.js'
29+
- '**.md'
2830
- '**.xml'
2931
- '.php-cs-fixer.dist.php'
3032
- '.phpcs.dist.xml'
@@ -128,7 +130,7 @@ jobs:
128130
uses: ./.github/workflows/rector.yml
129131

130132
unit_tests:
131-
name: PHPUnit Tests
133+
name: PHPUnit
132134
needs: [check, php-cs-fixer]
133135
if: |
134136
needs.check.outputs.php > 0 ||
@@ -137,6 +139,14 @@ jobs:
137139
needs.check.outputs.workflow > 0
138140
uses: ./.github/workflows/phpunit.yml
139141

142+
spellcheck:
143+
name: Spellcheck
144+
needs: [check]
145+
if: |
146+
needs.check.outputs.markdown > 0 ||
147+
needs.check.outputs.workflow > 0
148+
uses: ./.github/workflows/spellcheck.yml
149+
140150
cypress:
141151
name: Cypress E2E Tests
142152
needs: [check, php-cs-fixer]

app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ public function generateChart(): array
201201
break;
202202
case Mage_Reports_Helper_Data::PERIOD_7_DAYS:
203203
case Mage_Reports_Helper_Data::PERIOD_1_MONTH:
204+
case Mage_Reports_Helper_Data::PERIOD_3_MONTHS:
205+
case Mage_Reports_Helper_Data::PERIOD_6_MONTHS:
204206
$this->_axisLabels[$idx][$_index] = $this->formatDate(
205207
new Zend_Date($_label, 'yyyy-MM-dd'),
206208
);
@@ -243,9 +245,10 @@ private function getChartDatasAndDates(): array
243245
$date = '';
244246
$dates = [];
245247
$datas = [];
248+
$period = $this->getDataHelper()->getParam('period');
246249

247250
while ($dateStart->compare($dateEnd) < 0) {
248-
switch ($this->getDataHelper()->getParam('period')) {
251+
switch ($period) {
249252
case Mage_Reports_Helper_Data::PERIOD_24_HOURS:
250253
$date = $dateStart->toString('yyyy-MM-dd HH:00');
251254
$dateStart->addHour(1);
@@ -255,22 +258,52 @@ private function getChartDatasAndDates(): array
255258
$date = $dateStart->toString('yyyy-MM-dd');
256259
$dateStart->addDay(1);
257260
break;
261+
case Mage_Reports_Helper_Data::PERIOD_3_MONTHS:
262+
case Mage_Reports_Helper_Data::PERIOD_6_MONTHS:
263+
$date = $dateStart->toString('yyyy-MM-dd');
264+
$dateStart->addWeek(1);
265+
break;
258266
case Mage_Reports_Helper_Data::PERIOD_1_YEAR:
259267
case Mage_Reports_Helper_Data::PERIOD_2_YEARS:
260268
$date = $dateStart->toString('yyyy-MM');
261269
$dateStart->addMonth(1);
262270
break;
263271
}
272+
if (in_array($period, [
273+
Mage_Reports_Helper_Data::PERIOD_3_MONTHS,
274+
Mage_Reports_Helper_Data::PERIOD_6_MONTHS,
275+
])) {
276+
$axisTimestamps = [];
277+
foreach ($this->_axisLabels['x'] as $axisDate) {
278+
$axisTimestamps[] = (new Zend_Date($axisDate, 'yyyy-MM-dd'))->getTimestamp();
279+
}
280+
}
264281
foreach (array_keys($this->getAllSeries()) as $index) {
265-
if (in_array($date, $this->_axisLabels['x'])) {
266-
$datas[$index][] = (float) array_shift($this->_allSeries[$index]);
282+
if (isset($axisTimestamps)) {
283+
$dateObj = new Zend_Date($date, 'yyyy-MM-dd');
284+
$weekStartTs = $dateObj->getTimestamp();
285+
$weekEndTs = $dateObj->addWeek(1)->getTimestamp();
286+
287+
$found = false;
288+
foreach ($axisTimestamps as $axisTs) {
289+
if ($axisTs >= $weekStartTs && $axisTs < $weekEndTs) {
290+
$datas[$index][] = (float) array_shift($this->_allSeries[$index]);
291+
$found = true;
292+
break;
293+
}
294+
}
295+
296+
if (!$found) {
297+
$datas[$index][] = 0;
298+
}
267299
} else {
268-
$datas[$index][] = 0;
300+
$datas[$index][] = in_array($date, $this->_axisLabels['x'])
301+
? (float) array_shift($this->_allSeries[$index])
302+
: 0;
269303
}
270304
}
271305
$dates[] = $date;
272306
}
273-
274307
return [$datas, $dates];
275308
}
276309

app/code/core/Mage/Adminhtml/Block/Widget/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @category Mage
1111
* @package Mage_Adminhtml
1212
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
13-
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
13+
* @copyright Copyright (c) 2019-2025 The OpenMage Contributors (https://www.openmage.org)
1414
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1515
*/
1616

0 commit comments

Comments
 (0)