Skip to content

Commit 3e35108

Browse files
authored
[6.0] Fixes the missing modified start and end date filter to articled API endpoint (joomla#45142)
1 parent 871c5c7 commit 3e35108

File tree

14 files changed

+1498
-540
lines changed

14 files changed

+1498
-540
lines changed

administrator/components/com_content/src/Model/ArticlesModel.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,22 @@ protected function getListQuery()
504504
->bind(':tag', $tag, ParameterType::INTEGER);
505505
}
506506

507+
// Filter by date after modified date.
508+
$modifiedStartDateTime = $this->getState('filter.modified_start');
509+
510+
if (!empty($modifiedStartDateTime)) {
511+
$query->where($db->quoteName('a.modified') . ' >= :startDate')
512+
->bind(':startDate', $modifiedStartDateTime);
513+
}
514+
515+
// Filter by date before modified date.
516+
$modifiedEndDateTime = $this->getState('filter.modified_end');
517+
518+
if (!empty($modifiedEndDateTime)) {
519+
$query->where($db->quoteName('a.modified') . ' <= :endDate')
520+
->bind(':endDate', $modifiedEndDateTime);
521+
}
522+
507523
// Add the list ordering clause.
508524
$orderCol = $this->state->get('list.ordering', $defaultOrdering);
509525
$orderDirn = $this->state->get('list.direction', 'DESC');

administrator/components/com_users/src/Model/BackupcodesModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function isBackupCode($code, ?User $user = null): bool
252252
*/
253253
$otherResult = false;
254254

255-
$temp1 = '';
255+
$temp1 = [];
256256

257257
for ($i = 0; $i < 10; $i++) {
258258
$temp1[$i] = random_int(0, 99999999);

api/components/com_content/src/Controller/ArticlesController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ public function displayList()
8282
$this->modelState->set('filter.language', $filter->clean($apiFilterInfo['language'], 'STRING'));
8383
}
8484

85+
if (\array_key_exists('modified_start', $apiFilterInfo)) {
86+
$this->modelState->set('filter.modified_start', $filter->clean($apiFilterInfo['modified_start'], 'STRING'));
87+
}
88+
89+
if (\array_key_exists('modified_end', $apiFilterInfo)) {
90+
$this->modelState->set('filter.modified_end', $filter->clean($apiFilterInfo['modified_end'], 'STRING'));
91+
}
92+
8593
$apiListInfo = $this->input->get('list', [], 'array');
8694

8795
if (\array_key_exists('ordering', $apiListInfo)) {

build/build-modules-js/javascript/build-bootstrap-js.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
} from 'node:fs/promises';
44
import { resolve } from 'node:path';
55
import { transform } from 'esbuild';
6-
import rimraf from 'rimraf';
6+
import { rimrafSync } from 'rimraf';
77
import { rollup } from 'rollup';
88
import { nodeResolve } from '@rollup/plugin-node-resolve';
99
import replace from '@rollup/plugin-replace';
@@ -65,6 +65,13 @@ const build = async () => {
6565
],
6666
}),
6767
],
68+
});
69+
70+
await bundle.write({
71+
format: 'es',
72+
sourcemap: false,
73+
dir: outputFolder,
74+
chunkFileNames: '[name].js',
6875
manualChunks: {
6976
alert: ['build/media_source/vendor/bootstrap/js/alert.es6.js'],
7077
button: ['build/media_source/vendor/bootstrap/js/button.es6.js'],
@@ -86,19 +93,12 @@ const build = async () => {
8693
},
8794
});
8895

89-
await bundle.write({
90-
format: 'es',
91-
sourcemap: false,
92-
dir: outputFolder,
93-
chunkFileNames: '[name].js',
94-
});
95-
9696
// closes the bundle
9797
await bundle.close();
9898
};
9999

100100
export const bootstrapJs = async () => {
101-
rimraf.sync(resolve(outputFolder));
101+
rimrafSync(resolve(outputFolder));
102102

103103
try {
104104
await build(resolve(inputFolder, 'index.es6.js'));

build/build.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ function clean_checkout(string $dir)
122122
system('find libraries/vendor -name _config.yml | xargs rm -rf -');
123123
system('find libraries/vendor -name .bowerrc | xargs rm -rf -');
124124
system('find libraries/vendor -name bower.json | xargs rm -rf -');
125+
system('find libraries/vendor -name .drone.yml | xargs rm -rf -');
126+
system('find libraries/vendor -name .drone.jsonnet | xargs rm -rf -');
125127
system('rm -rf libraries/vendor/bin');
126128

127129
// aldo26-matthias/idna-convert

build/media_source/plg_installer_webinstaller/js/client.es6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ customElements.whenDefined('joomla-tab').then(() => {
413413
link.click();
414414
}
415415

416-
if (link.hasAttribute('aria-expanded') && link.getAttribute('aria-expanded') === 'true' && !instance) {
416+
if (link.hasAttribute('aria-selected') && link.getAttribute('aria-selected') === 'true' && !instance) {
417417
instance = new WebInstaller();
418418
instance.initialise();
419419
}

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"joomla/event": "^3.0.1",
6464
"joomla/filter": "^3.0.2",
6565
"joomla/filesystem": "^3.1.0",
66-
"joomla/http": "^3.0.1",
66+
"joomla/http": "^3.1.0",
6767
"joomla/input": "~3.0",
6868
"joomla/language": "~3.0",
6969
"joomla/oauth1": "~3.0",
@@ -74,7 +74,7 @@
7474
"joomla/string": "^3.0.1",
7575
"joomla/uri": "~3.0",
7676
"joomla/utilities": "~3.0",
77-
"algo26-matthias/idna-convert": "^3.1.1",
77+
"algo26-matthias/idna-convert": "^4.0.4",
7878
"defuse/php-encryption": "^2.4.0",
7979
"doctrine/inflector": "^1.4.4",
8080
"fig/link-util": "^1.2.0",
@@ -108,13 +108,13 @@
108108
"phpseclib/bcmath_compat": "^2.0.3",
109109
"jfcherng/php-diff": "^6.16.2",
110110
"voku/portable-utf8": "dev-joomla-5.3 as 6.0.13",
111-
"php-tuf/php-tuf": "^1.0.2",
111+
"php-tuf/php-tuf": "^1.0.3",
112112
"php-debugbar/php-debugbar": "^2.1.6"
113113
},
114114
"require-dev": {
115115
"phpunit/phpunit": "^9.6.22",
116116
"friendsofphp/php-cs-fixer": "^3.72.0",
117-
"squizlabs/php_codesniffer": "^3.11.3",
117+
"squizlabs/php_codesniffer": "^3.12.0",
118118
"joomla/mediawiki": "^3.0",
119119
"joomla/test": "~3.0",
120120
"phpstan/phpstan": "^2.1.8",

composer.lock

Lines changed: 31 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)