Commit Graph

253 Commits

Author SHA1 Message Date
Martin Kopp 92f2ffb3c6
Joomla! 4.4.4 Stable 2024-04-14 12:13:18 +02:00
David Jardin 1aed565bc2
update punycode library to include security fix (#43092) 2024-03-20 08:53:23 +01:00
David Jardin 069d85829a
[4.x] Fix JHTTP socket transport http version (#43001)
* Fix socket driver http version

* updated jhttp to patched version
2024-03-13 19:27:30 +01:00
Martin Carl Kopp 55c34bbc43
composer-patch1 (#42849) 2024-02-22 19:48:23 +01:00
Martin Kopp b0663caf26
Revert to dev
Signed-off-by: Martin Kopp <kopp05@infotech.ch>
2024-02-20 16:16:39 +01:00
Martin Kopp 55f2082f32
Joomla 4.4.3 Stable 2024-02-19 15:44:22 +01:00
Richard Fath 6358c9652c
Use maximebf/debugbar v1.19.0 (#41931) 2023-09-26 13:11:53 +02:00
Allon Moritz 38ff78cc41
Update dependencies (#41829) 2023-09-20 13:34:06 +02:00
Allon Moritz afc47c6a99
Change composer json file to two spaces (#41702) 2023-09-11 17:46:52 +02:00
Allon Moritz e481884831
Updates the dependencies (#41538)
* Updating dependencies

* Major update cypress

* Thanks for the reminder @brianteeman

* Composer

* weekend updates
2023-09-04 14:21:54 +02:00
Allon Moritz dd484f8ab8
Update dependencies (#41395) 2023-08-19 18:40:45 +02:00
Allon Moritz e5eb843950
Update dependencies (#40783)
* Update dependencies

* update

* update npm
2023-06-23 12:33:35 +02:00
Allon Moritz 2071a7bbde
Update dependencies (#40644)
* Update dependencies

* Update
2023-05-24 08:13:45 +02:00
Allon Moritz 8229caf16b Merge branch '4.3-dev' into 4.4-dev 2023-03-22 07:43:52 +01:00
Olivier Buisard a895531414 Merge branch '4.2-dev' into upmerge-2023-03-21
# Conflicts:
#	administrator/language/en-GB/install.xml
#	administrator/language/en-GB/langmetadata.xml
#	administrator/manifests/files/joomla.xml
#	administrator/manifests/packages/pkg_en-GB.xml
#	api/language/en-GB/install.xml
#	api/language/en-GB/langmetadata.xml
#	composer.json
#	composer.lock
#	installation/language/en-GB/langmetadata.xml
#	language/en-GB/install.xml
#	language/en-GB/langmetadata.xml
#	libraries/src/Version.php
2023-03-21 20:11:38 -04:00
Allon Moritz 7611824c5c
Move API system tests to cypress (#40135)
* tests

* api

* artiucles crud

* banners

* contact

* media

* media

* Remove codeception

* cs

* more traces of codeception

* readd certs

* dependencies

* more deps

* secret

* cs

* better doc

* write

* config workaround

* cs

* revert

* prepare db for api tests

* variable

* revert pool

* end connections

* no limit

* cs

* prefix

* Update tests/cypress/drone-system-run.sh

* run specific specs in drone

* Update tests/README.md

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update tests/cypress/integration/api/com_media/Files.cy.js

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update tests/cypress/integration/api/com_media/Files.cy.js

Co-authored-by: Brian Teeman <brian@teeman.net>

* postgres

* media on postgres

* sign

* cs

* remove more traces

* basic api tests

* cleanup

* path

* run recursive specs

* chmod images folder

* path to cms

* correct dependencies and better cleanup

* cleaner deps

* Update tests/cypress/drone-system-run.sh

Co-authored-by: Brian Teeman <brian@teeman.net>

* missing fields

* stabilize cleanup

* cs

* secret in install test

* order of tests

* optimize cleanup

* cs

* cache the connection

* revert connection cache

* docs

* Rename cypress to system

* lint

* simplification and docs

* docs

* better cleanup

* move

* merge conflict

* remove redundant connect

---------

Co-authored-by: Brian Teeman <brian@teeman.net>
2023-03-20 09:51:42 +01:00
Fedir Zinchuk 5025b5747c
PHP polyfills as explicit dependency (#39968) 2023-03-13 19:18:54 +01:00
Brian Teeman 26b53bae7e
[4.3] php-diff line endings (#40070) 2023-03-12 08:39:26 -04:00
Hannes Papenberg ffcab1889f
Updating voku/portable-utf8 (#39955) 2023-03-07 21:17:25 -05:00
Allon Moritz 6510c23711
Update dependencies (#39875) 2023-03-05 09:49:17 -05:00
tatankat 8f94ab0307
[4.x] Fix LDAP debugging functionality (#38388)
* Restore broken ldap debugging functionality

* Fix composer.lock

* Remove unnecessary change

* More recent symfony/ldap to include https://github.com/symfony/symfony/pull/47547

* fix hash in composer.lock

* Update composer.lock

---------
2023-01-30 14:15:37 +01:00
Olivier Buisard c608616220 Merge branch '4.2-dev' into upmerge-2023-01-20
# Conflicts:
#	administrator/components/com_admin/script.php
#	administrator/components/com_categories/src/Model/CategoryModel.php
#	administrator/components/com_config/src/Model/ApplicationModel.php
#	administrator/components/com_config/src/Model/ComponentModel.php
#	administrator/components/com_fields/src/Model/FieldModel.php
#	administrator/components/com_fields/src/Model/GroupModel.php
#	administrator/components/com_finder/src/Indexer/Query.php
#	administrator/components/com_finder/src/Service/HTML/Filter.php
#	administrator/components/com_finder/src/Service/HTML/Query.php
#	administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
#	administrator/components/com_languages/src/Model/StringsModel.php
#	administrator/components/com_menus/tmpl/items/modal.php
#	administrator/components/com_tags/src/Table/TagTable.php
#	administrator/components/com_users/src/Model/LevelsModel.php
#	administrator/components/com_users/src/Model/MailModel.php
#	administrator/components/com_users/src/Model/UserModel.php
#	administrator/modules/mod_quickicon/src/Helper/QuickIconHelper.php
#	components/com_config/src/Controller/ConfigController.php
#	components/com_content/src/Model/ArchiveModel.php
#	components/com_finder/src/Controller/SuggestionsController.php
#	components/com_tags/src/Model/TagModel.php
#	components/com_tags/src/Service/Router.php
#	components/com_tags/src/View/Tag/FeedView.php
#	components/com_tags/src/View/Tag/HtmlView.php
#	components/com_users/src/Controller/ProfileController.php
#	components/com_users/src/Controller/UserController.php
#	composer.lock
#	installation/src/Model/SetupModel.php
#	layouts/joomla/form/field/text.php
#	libraries/namespacemap.php
#	libraries/src/Component/Router/Rules/NomenuRules.php
#	libraries/src/Form/Field/TextField.php
#	libraries/src/Helper/ModuleHelper.php
#	libraries/src/MVC/Model/ListModel.php
#	libraries/src/Object/CMSObject.php
#	libraries/src/Table/ContentType.php
#	plugins/authentication/cookie/src/Extension/Cookie.php
#	plugins/behaviour/versionable/src/Extension/Versionable.php
#	plugins/editors/tinymce/src/Field/TinymcebuilderField.php
#	plugins/extension/namespacemap/src/Extension/NamespaceMap.php
#	plugins/quickicon/extensionupdate/src/Extension/Extensionupdate.php
#	plugins/quickicon/overridecheck/src/Extension/OverrideCheck.php
#	plugins/quickicon/privacycheck/privacycheck.php
#	plugins/user/joomla/joomla.php
2023-01-20 20:32:33 -05:00
Allon Moritz 72af961e21
[4.2] PHP8.2 Replace deprecated utf8 encode/decode to mb string (#39583)
* Replace deprecated utf8 encode/decode to mb string

* Make mb string polyfill dependency explicit

* Order
2023-01-14 12:01:48 +01:00
Hannes Papenberg b4b0f928cf
[4.3] Adding phan static code analyser (#39002)
* Adding phan static code analyser

* Adding phan configuration files

* Codestyle

* Adding php-ast extension

* Trying different way to install php-ast

* Using our own php7.4-ast docker image

* Removing unnecessary line
2022-10-21 12:19:30 +02:00
Brian Teeman 8d38cb0d80
[4.3] Template Diff View (#38823) 2022-10-09 13:04:23 -04:00
Nicholas K. Dionysopoulos 205c7a5f7f
Fix/38233 webauth preload fido (#38664)
* Use cached FIDO metadata

Places a copy of fido.jwt in the plugin's directory

* Use cached FIDO metadata

Use the cached FIDO metadata in the plugin

* Use cached FIDO metadata

Remove unused local file fallback

* Use cached FIDO metadata

Simplify

* Use cached FIDO metadata

Update Joomla build script

* Use cached FIDO metadata

Let's not break the build if the FIDO server is down

* Use cached FIDO metadata

Do not include the fido.jwt in the repo

* Use cached FIDO metadata

Make sure not to re-fetch the fido.jwt file if it already exists.

* Use cached FIDO metadata

Move the check for the fido.jwt file right after composer install, do not try to fetch the file twice

* Use cached FIDO metadata

Update lang string

* Use cached FIDO metadata

Set the attestation support to disabled by default

* Update deleted files to PR #38664

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
2022-09-02 21:37:25 +02:00
Nicholas K. Dionysopoulos 337b3893cb
Add bcmath_compat polyfill for servers without BCmath / GMP support (#38488)
Close #38485
2022-08-17 20:12:17 +02:00
Roland Dalmulder c3756113df
Sodium compat update 1.17.1
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2022-08-14 15:42:05 +02:00
Roland Dalmulder 3fc3cf8ff6
Sodium compat update 1.17.1
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2022-08-14 15:32:51 +02:00
Harald Leithner 6a01d923b4 PSR12 2022-06-27 20:22:40 +02:00
Nicholas K. Dionysopoulos 170f91a637
Refactored WebAuthn with Windows Hello support (#37910)
* Refactored WebAuthn plugin

* Fix the WebAuthn management page which was broken in https://github.com/joomla/joomla-cms/pull/37464

* Fix wrong `@since` doc tag

* Fix docblock typo

* Fix docblock typo

* Fix docblock typo

* Fix docblock typo

* Fix docblock typo

* Fix broken management interface

* Make unnecessarily static method back into non-static

* Replace static helper with injected object

* Come on, commit the ENTIRE file!

* Use the user factory

* Fix error when going through the user factory

* Fix: cannot add WebAuthn authenticator right back after deleting it

* Remove useless switch branch

* Remove useless exception

* Display make and model of the authenticator, if possible

* Add missing JWT signature algorithms

* Fix copyright date

* Fix for PHP 8 using FIDO keys and Android phones

* Reactivate the tooltips after adding an authenticator

* Option to disable the attestation support

* The Windows Hello icon was invisible on white background

* Attempt to fix Appveyor not having Sodium in the Windows build

* Work around third party library bug...

* Create events in a forwards-compatible manner

* Concrete events

* Fix event woes

* Update plugins/system/webauthn/webauthn.xml

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update administrator/language/en-GB/plg_system_webauthn.ini

Co-authored-by: Brian Teeman <brian@teeman.net>

* Improve the layout for editing an authenticator

It now follows the Bootstrap 5 form aesthetic. Moreover,
there are gaps between the text input and the Save and
Cancel buttons.

* Confirm deletion of authenticators

* Make the bots happy again

* Code polishing

* Marking classes final
* Use setApplication / getApplication in the plugin class
* Remove unused `$db` from the plugin class

* Blind fix

Currently #38060 has broken everything it seems?

* Bring application injection in sync with core

* Remove whitespace

* Add use statement

* Fix wrong event creation in AjaxHandlerLogin

* License change

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Roland Dalmulder <contact@rolandd.com>
Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
Co-authored-by: Harald Leithner <leithner@itronic.at>
Co-authored-by: George Wilson <georgejameswilson@googlemail.com>
2022-06-27 19:16:07 +02:00
Roland Dalmulder d99b841b7f
Merge branch '4.1-dev' into 4.2-dev
# Conflicts:
#	composer.lock
2022-04-26 18:55:21 +02:00
Hannes Papenberg 62053ccc88
Updating joomla-projects/joomla-browser (#37565) 2022-04-22 07:47:09 +02:00
Allon Moritz 99ce07ff5e
[4.1] Use to PHP 8.1 fixes for debug bar dependency (#37488) 2022-04-13 19:47:47 +01:00
Benjamin Trenkle f49c451d1e
Bump to 4.1.1 stable 2022-03-29 15:27:09 +02:00
Richard Fath 5eed656b68
Composer update maximebf/debugbar (#37279) 2022-03-15 23:41:55 +00:00
Benjamin Trenkle 92d7cf3eb8
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into HEAD
# Conflicts:
#	.drone.yml
#	administrator/language/en-GB/install.xml
#	administrator/language/en-GB/langmetadata.xml
#	administrator/manifests/files/joomla.xml
#	administrator/manifests/packages/pkg_en-GB.xml
#	api/components/com_categories/src/Controller/CategoriesController.php
#	api/language/en-GB/install.xml
#	api/language/en-GB/langmetadata.xml
#	composer.lock
#	installation/language/en-GB/langmetadata.xml
#	language/en-GB/install.xml
#	language/en-GB/langmetadata.xml
#	layouts/joomla/content/category_default.php
#	libraries/src/Application/ConsoleApplication.php
#	libraries/src/Version.php
#	tests/Codeception/acceptance/administrator/components/com_media/MediaListCest.php
2022-01-16 03:26:30 +01:00
wilsonge 1ac91f5bc6
Update Tobscure library to be PHP 8.1 compat 2022-01-08 21:04:12 +00:00
wilsonge d06121a507
Merge branch '3.10-dev' into 4.0-dev 2022-01-08 20:35:27 +00:00
wilsonge 43a8fb0e40
Allow our phpcode sniffer composer plugin to run 2022-01-08 18:59:45 +00:00
Tobias Zulauf 0093a18757
Update simplepie to 1.3.3 (#36358)
* Update simplepie to 1.3.2 & phar-stream-wrapper to 2.2.2

* update to simplepie 1.3.3 to fix the version
2022-01-08 18:56:11 +01:00
Harald Leithner 3fe13535b9
Update paragonie sodium_compat to 1.17.0 (#36491)
Co-authored-by: Benjamin Trenkle <bembelimen@users.noreply.github.com>
2022-01-02 10:46:54 +01:00
Benjamin Trenkle 6dc01f5c49
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into 4.1-dev
# Conflicts:
#	.drone.yml
#	administrator/components/com_admin/script.php
#	administrator/components/com_content/src/Model/ArticleModel.php
#	administrator/components/com_templates/src/View/Template/HtmlView.php
#	composer.lock
#	installation/sql/mysql/base.sql
#	installation/sql/postgresql/base.sql
#	layouts/plugins/editors/tinymce/field/tinymcebuilder.php
#	package-lock.json
#	package.json
#	tests/Codeception/api.suite.dist.yml
2021-12-31 16:28:26 +01:00
Nicola Galgano 23cb708e2c
[4] composer update maximebf/debugbar to 1.17 (#36431) 2021-12-27 11:44:48 +00:00
Tushar 3be67ab042
[4.1] [SOC 21] Add a Scheduled Tasks Infrastructure to Joomla (#35143)
* Fix task filter ordering

Order now matches the order of columns the db table.

Ref: joomla/joomla-cms#35143#discussion_r700213211 / @brianteeman.

* Improve com_scheduler language strings

Improves a task form hint, a label.

Refs: joomla/joomla-cms#35143#discussion_r700203125
      joomla/joomla-cms#35143#discussion_r700202862
      @brianteeman.

* Scheduler runner as a shutdown_function

The schedule runner trigger is now bound as a shutdown_function.
The function is registered by a onBeforeRender listener.

* Enhance task locks and events

- Updates task locks (the `locked` column) so they now use a timestamp
  to allow for recovery from a fatal failure. Includes updates to SQL
  scripts.
- Dispatch a new onTaskRecoverFailure event on "recovery" from a fatal
  failure.
- Actually dispatch task exit events (oops!)
- Update the event class declaration for onExecuteTask to be more
  elegant, readable. [1]

[1]: http://joomla/joomla-cms#35143#discussion_r700897628 / @Denitz

* Add a sanity check to TaskPluginTrait

Adds a pre-broadcast sanity check for plugins with invalid an TASK_MAP.
The advertiseRoutines method will no longer try to advertise tasks that
don't have a corresponding 'langConstPrefix'.

* Fix fatal task failure check

Fixes the failure check (the lock should not be null) and
enhances a comment + styling.

* Increase scheduler plugin hook priority

Increases the priority for the registerRunner hook to PHP_INT_MAX,
although I'm not yet sure if onBeforeRender is the first event to be
fired (probably not).

* Fix event dispatchers in the Task class

The onTaskRecoverFailure and exit task weren't passing the
event name to dispatchers. Oops!
P.S. I don't know why that's required with the new Event classes.

* Cleanup com_scheduler manifest

Removes menu link (was supposed to go before).

* Add filtering by lock state in TasksModel

Adds support for filtering by the "lock" state of a task. Also in
the process defines different lock levels: hard locks and soft locks.
I think in the future, the filtering states should maybe
go into a namespace/class for constants.

* Add task timeout config to "com_scheduler"

Adds a configuration field for a global task timeout.
The timeout serves the purpose of safely declaring a hard-limit on how
long tasks can be considered as running once a lock on them is acquired.
Right now the default is 300s (5min) but this can be re-evaluated
in the future to a more sensible value if needed.

* Update language file for "com_scheduler"

Adds new constants for the component configuration form.

* Bugfix and update Scheduler API class

- Now fetches all fields from the DB (this broke things as the `locked`
  field was never fetched!!)
- Adds locked state filtering as a default (excludes hard-locked jobs).

* Add priority column to `#__scheduler_tasks`

- Adds a priority column to the tasks table, also a linked index.
- Fixes update SQL script styling.

* Add task priority to Task form and filter form

* Add priority, multi-ordering support to TasksModel

- Adds priority to the filter_fields config.
- Adds support for a `list.multi_ordering` model state variable which
  can be used to sort by multiple fields (limitation for the standard
  `list.ordering` `list.direction` model). The way this is right now
  means we pass unquoted names to the db which should be fixed in the
  future. In any case this is not exposed in the filter form but only
  meant to be used by internal handlers interacting with the model.
- Fixes behaviour for high collision ordering fields (used to order
  first by title and then by the targeted column).

* Update task timeout with config fetch

The Task driver class now fetches the task timeout from the component
config.

* Add priority-aware task queue to Scheduler class

The fetchTasks() method now uses multi-ordering with priority as the
primary ordering column to make the task queue priority aware.

* Update language files for com_scheduler

- Adds language constants for the task priority config in the task and
  tasks filter form.
- Sneaks in a description attribute for the priority form field.

* Bugfix and add an 'Advanced' tab to the task form

- Moves the log config and task priority to the advanced tab.
- Fixes a bug with using `joomla.edit.params`, which is now used
  for rendering all injected task routine parameters.

* Enhance orphan task handling in Task driver

- Dispatches now an event if task to run is orphaned, then skip the
  execution and exit early with a new exit code.
- Adds a skipExecution method to the Task class.
- Enhanced the handleExit method through an events map to dispatch
  other events based on exit code.
- Adds a new code for orphaned tasks to the Status namespace class.

* Enhance orphan handling in Scheduler, update lang

- Scheduler now includes orphaned tasks by default. Before this,
  the ::runTask() method never got to handling or logging orphaned
  tasks because of the default filtering excluding them.
- Adds exceptional log for orphaned tasks.
- Update language file to match.

* Add demo task routines to stress memory

Adds task routines to test scheduled tasks when either the system memory
runs out or the PHP memory_limit is exceeded.

* Add sleep demo task routine

Renames the first demo task routine and adds a form field to configure
the sleep duration.

* Update language files for plgTaskDemotasks

Adds constants for new task routines and updates some others.

* Cleanup and bugfix com_scheduler

- Removes redundant pass-by-reference
- Makes closures static where possible
- Fixes problematic casts
- Adds some missing parenthesis
- Removes unused variables
- Removes unused method overrides
- Miscellaneous changes

Ref: joomla/joomla-cms#35143 / @Denitz

* Improve consistency, extend `#__scheduler_tasks`

Adds `checked_out` and `checkout_out_time` to `#__scheduler_tasks`. Also
adds index for `checked_out`.

Ref: joomla/joomla-cms#35143#issuecomment-911819994 / @Denitz

* Remove language autoload from ScheduleRunner

Ref: joomla/joomla-cms#35143#issuecomment-911819994 / @Denitz

* Fix missed errant cast

Fixes a leftover problematic cast in IntervalField.

* Patch Task::releaseLock()

The method now updates the Task properties, so they now keep in sync
with db updates and can be used reliably by other code.

* Add plgSystemTaskNotification

This plugin is responsible for sending out email notifications for
task failures and optionally also successful executions.

* Add language files for plgSystemTaskNotifications

* Add SQL DDL for task notification mail templates

* Add auto-install SQL (plgSystemTaskNotifications)

* Add language autoload for plgSysTaskNotification

* Patch auto-install SQL scripts

- Adds installation DDL in installation script (supports.sql)
- Adds the `extension` column in update scripts.

* Cleanup plg taskNotification

* Fix Scheduler::fetchTasks() default behaviour

Shifts the list config for the task queue to the fetchTaskRecord()
method. This makes more sense as the fetchTasks() method is supposed
to be a transparent API method to interact with the TasksModel rather
than have an overriding default like the list.multi_ordering state
variable as a default. Also changes the default ordering behaviour for
sensibility and adds some comments for clarity.

* Add explicit id, title filtering to TasksModel

These are largely redundant to the search filter but convenient to use
and when only the title should be targeted. It turned out I assumed
we had this in the model and so was an outstanding bug with the
Scheduler class. Probably, can use refactor later (or _should_).

* Enhance ExecRuleHelper::nextExec()

Adds a new option $nowBasis argument, when provided uses 'now' as the
last execution. Useful when skipping executions, so we're not actually
updating the last exec.

* Add new Task::Status constant

Adds a status code for when no (matching) task exists.

* Improve comments in the TaskOption class

Improves comment structure, adds some missing punctuation.

* Update the Scheduler class

- Renames fetchTasks() => fetchTaskRecords().
- Fixes broken id search (l190).
- Updates runTask() return (now returns the Task exit code).
- Adds TASK_QUEUE filters and list config as class constants so other
  extensions can reliably use them to get the queue behaviour (should
  this somehow be baked in?).
- Updates return for fetchTaskRecords(), which could return a false
  from the model query before but now would an empty array.

* Bugfix Task::skipExecution()

Now actually skips the execution and advances the task to the next
execution slot relative to 'now'.

* Add scheduler:list console command

Command to list scheduled tasks.

* Add scheduler:run command

Command to run scheduled tasks. Supports triggering the task queue
as well as individual tasks, matching either by id or title. Right now,
due some code-smell fixes and perhaps behavior adjustments. An example,
perhaps the title match could support running all tasks matching a title
with the --all flag.

* Add autoload for new commands

Adds new commands to the application loader and dependency injection
class used by other core commands.

* Add plugin plgTaskCheckFiles

Adds plgTaskCheckFiles. This plugin includes currently a single task
routine which offers the ability to check images in a directory
for dimensions and resize ones that are too big!

* Enhance form for image size routine

Adds sensible defaults, require attributes, etc.

* Update form for get_request routine

Updates the fieldset so its translated right.

* Update language file for com_scheduler

Adds a new constant for the task_params fieldset so plugins can use it
without defining their own.

* Patch task form

Patches the "trigger" field to make it hidden. This is temporary as it
should be removed altogether soon both in the form and the db table.

* Patch exit handling in Task class

The handleExit() method needed the exit code to be passed while it was
available already in the $snapshot class property. This also created
room for error and the final handleExit() return meant that generic
failures were never broadcasted through the failure event.

* Patch exit handling in Task class

The handleExit() method needed the exit code to be passed while it was
available already in the $snapshot class property. This also created
room for error and the final handleExit() return meant that generic
failures were never broadcasted through the failure event.

* Add support for mailing task outputs

Implements support for mailing out task output attachments and
in the body. Not robust but just works for a demo (needs to be
redone).

* Update SQL for task notification templates

Adds the "task_output" param.

* Add output file support in GET request routine

Hastily done and to be redone but this works okay as a POC.

* Patch task class

Fixes the execution time record/next execution which broke somewhere
along before. This is a quick patch and should be fixed as suggested
by the comment.

* Disable deprecated routineEndMessage [CheckFiles]

* Improve code quality, consistency and style

- Removes some redundant comments.
- Reduces reliance on implicit PHP casts.
- Refactors to a more functional approach in TaskModel::save() and calls
  nested within.
- Uses allowed Priority::MAX as plgSystemSchedulerunner listener
  priority.
- Refactors some abbreviated variable names.
- Changes uses of the 'GMT' to 'UTC' (more correct and consistent with
  existing Joomla code)
- Separates some variable assignments and tests for improved
  readability.
- Starts removing imports for native global functions and objects.
  This should be a gradual process.
- Cover up a couple copy-and-paste inconsistencies. oops!
- Reverts a styling regression in old code.

Ref: joomla/joomla-cms#35143 / @nibra / @HLeithner / @brianteeman.

* Make SchedulerHelper abstract

Makes SchedulerHelper an abstract class. This also eliminates the need
for a private constructor.

Refs: joomla/joomla-cms/#35143#discussion_r710998565
     / joomla/joomla-cms#35143#discussion_r710999157
     / @PhilETaylor
     / @nibra.

* Add request hash protection for scheduler runner

- Adds a configuration tab for the lazy scheduler in ComScheduler with
  configuration switches for disabling the lazy scheduler and protecting
  it with a request hash.
- Adds configuration checks in plgSystemScheduleRunner to only run if
  either hash matches or it's not protected.

* Bugfix scheduleRunner event subscription behaviour

ScheduleRunner attached itself to events even with comScheduler
disabled. This was likely because it utilised a constructor short which
is useful only with the pre-4.x event-method model.
This commit adds checks for the component straight to the
getSubscribedEvents() method and also adds a check for the lazy
scheduler switch in com_scheduler config params.

Refs: @Denitz / joomla/joomla-cms#35143#issuecomment-911453500.

* Add rule for manual-only task invocation

Adds an execution rule for when a task should only run when manually
invoked. Also renames internally the "custom" rule to "cron-expression".

* Refactor and extend TaskModel, TaskTable

- Updates TaskModel for changes in the Task form.
- Extends and refactors TaskModel to both support to both support
  the new manual invocation only rule and for better behaviour with
  setting some fields initially in the database.
- Adds a Task::bind() override to TaskTable and changes a default
  param to support updating fields to NULL through AdminModel::save().

* Update ExecRuleHelper

- Update with changes to the Task form.
- Removes imports for native global functions.

* Update language constants for com_scheduler

- Adds language constants for new Scheduler config fields.
- Refactors some language constants for better, more uniform naming.

* Cleanup Task class

- Removes outdated info from handleExit() PHP-doc.
- Removes imports for native global symbols.

* Update com_scheduler manifest

- Adds some missing fields and fixes code-style.

* Apply code-style suggestions from code review

- Fixes styling for some docblocks.
- Fixes copyright header alignment for consistency (non-exhaustive).
- Adds trailing commas for multi-line array declarations (probably non-exhaustive).
- Adds explicit name-spacing for global native symbols (likely non-exhaustive).
- Misc code-style improvements.

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Apply code-style suggestions from code review

- Fixes styling for some docblocks.
- Fixes copyright header alignment for consistency (non-exhaustive).
- Adds trailing commas for multi-line array declarations (probably non-exhaustive).
- Adds explicit name-spacing for global native symbols (likely non-exhaustive).
- Misc code-style improvements.

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Clean up usage

* Add AJAX requests script to scheduleRunner

JS sets up a navigator.sendBeacon() callback to make
requests to trigger a `com_ajax` backed AJAX listener offered by
plgSystemScheduleRunner.

* Update manifest for plgSystemScheduleRunner

Adds the new media asset folder, fills in some missing fields and
fixes the language field.

* Add scheduleRunner listener to inject JS

- Removes `shutdown_function` behavior to register the scheduleRunner.
- Adds listener method to inject the trigger JS on the
  `onBeforeCompileHead` event.
- Fixes copyright header styling.
- Reduces event subscription stage check complexity. (Ref: @Denitz /
  joomla-projects/soc21_website-cronjob#4#commitcomment-57308547)
- Adds `com_scheduler` component config as class property.
- Change scheduleRunner's subscription event to `onAjaxRunScheduler`.

* Add scheduleRunner doc and missing checks

- Adds descriptive doc in the class docblock.
- Adds missing checks to the runScheduler() method.

* Fix `created_by` auto set on task save

- TaskTable::save() now sets the `created_by` field  correctly.
- Adds and fixes existing checks for field auto-set.

* Cleanup and enhance TaskTable docs

- Fix copyright style.
- Enhance doc blocks.
- Cleanup.

* Fix plugin manifests

- Lowercase <name>.
- Adds missing fields and missing <files> nodes.
- Fixes XML styling (tasknotification.xml)

Ref: @bembelimen

* Revert changes to the modules/select template

Reverts file to 4.1-dev state.

* Add standard routine handler

`standardRoutineHandler()` can take care of initialising the routine,
calling the associated callable and ending the routine all without
any logic in the plugin class if each routine has a corresponding
callable.

* Fix copyright formatting

* Update Task\Status

Adds status code for invalid return and improves member doc blocks.

* Refactor TaskPluginTrait

- Renames methods:
 - `taskLog()` => `logTask()`
 - `taskEnd()` => `endRoutine()`
 - `taskStart()` => `initRoutine()`
- Upgrade `enhanceTaskItemForm()` to a complete event handler. For
  plugins targeting only the task form, this method can now be mapped
  straight to the `onContentPrepareForm` event.
- Code style improvements and fixes for global namespace qualification
  on some `\Exception` references.
- More explicit checks on variables.
- `Event` type arguments are now `EventInterface` so other
  implementations stay compatible.
- Removes deprecated logging nd `$log` param from `endRoutine()`.

* Improve TaskPluginTrait documentation

Adds and improves on the information in the doc blocks with context,
usage hints and related information. Also updates some parameter
information and fixes the tag order (`@since` <=> `@throws`).

* Implement suggestions on TaskPluginTrait

- Refactors `initRoutine()` => `startRoutine()`
- Return true for irrelevant enhanceTaskItemForm() contexts.
- Path checks for routine forms.
- Allow only class methods with `standardRoutineHandler()`
- Adds signature checks on standard routine methods.
- Adds validation on routine return codes against `Task\Status`.

* Update TaskPluginTrait::standardRoutineHandler()

Now enforces a single required parameter of type `ExecuteTaskEvent`
(from `EventInterface`).

* Update task plugins

- Remove methods now offered by TaskPluginTrait.
- The 'call' TASKS_MAP param is now 'method'.
- Update event subscriptions.
- Update docs.
- Improve code-style and copyright blocks.

* Ignore user aborts on scheduler trigger

Adds attempt to set the INI `ignore_user_abort` to true.
Also enhances some docs.

* Update TaskPluginTrait doc

Updates signature reference for standard routine methods.

* Rename status code

Renames `Task\Status::NO_TIME` to `Task\Status::RUNNING`.

* Add config options for scheduleRunner

Adds config option for the client side request intervals
for the scheduler trigger. Also fixes some showon attributes in
the com_scheduler config form.

* Add removal of time limit on task runs
Add test task permission
Add webcron, test task, lazycron entry points

* Fix broken interval run when setting custom value

* Set correct lazyCron URL and run it at the beginning
Prevent running LazyCron when not in html view or if lazyCron is not enabled
Implement hash check for webCron

* Rebuild JS
Implement test runner

* Finish test cron

* Fix CS

* Revert SQL query

* Add webcron to scheduler config

Updates the `com_scheduler` config.xml with the webcron fieldset.

* Add webcron key autogen and more to Schedulerunner

- Schedulerunner auto-generates the webcron key and does some form
  usability enhancements on the config form (much like the user API
  token plugin).

* Add custom field for webcron link

- Adds new field 'WebcronLinkField', this field is not really needed
  except for to support the custom layout location.
- Allows for the webcron link to be copies on click, much like the user
  API token field.
- Adds field JS to the `com_scheduler` media source provider.

* Update com_scheduler language file

Adds new strings for the config form and updates some refs.

* Fix regression in Scheduler class

- Fix regression due to newly protected status
  of Task::snapshot + accessor.
- Update some doc-blocks and related formatting.
- Optimise some imports.
- Minor miscellaneous changes.

* Fix test run JS

Fixes apparent JS parse error on non-zero task exits.

* Improve form manipulation code

- Check for `com_scheduler` in the subject table for table event.
- Minor code simplification.

* Clean up redundant field from Tasks table

- Remove redundant `trigger` field from `#__scheduler_tasks`.
  - From install and update SQL.
  - Task item form.
  - Language file.
- Fix regression in GenericDataException ref.
- Minor styling/doc fixes and upgrades.

* Remove global task configuration config

- Removes task configuration config from `plgSystemTasknotifications`
  plugin config.
- ! Does not update any usages.

* Add task notification config as injected form

- Task notification config is now injected into the task item form.
- ! Usages are not updated.

* Improve plgSystemTaskNotification code style

- Updates docs.
- Improves docblocks, general code style for compliance with unenforced
  Joomla! style guide.

* Fix params display in task view

* Add fieldset labels for task form

- Adds missing fieldset labels.
- Adds some comments and fixes marginally code-style.

* Update task notification logic

- Replaces checks with updated task item configuration.
- Improves logging (additional checks).
- Makes file attachment handling safer.
- Fixes/updates code-style.

* Update plgSystemTaskNotification language file

- Adds new constants for logging.
- Fixes ordering.

* Fix Task driver behavior

The run() method now updates the object state instead of leaving it
to releaseLock(). The class continues to appear a clunky build :D.

* Fix TasksRunCommand regression

* Fix scheduleRunner default behaviour

- Uses again sensible defaults (enabled lazy cron).
- Check webcron.enabled.
- Some useful logging.
- Improved docblocks.

* Update scheduleRunner language files

Adds new constant for a logging string.

* Update and fix code-style

- Fix license header formatting.
- Fix doc phpdoc tag ordering.
- Cleanup and marginally improve doc-blocks.
- Fix unqualified global refs in doc-blocks.
- Misc formatting fixes/improvements.
- Remove phpcs ignores.

* Revert drone

* Update com_scheduler language file

- Missing constant.
- Ordering.

* Apply suggestions from code review

Code-style and language improvements.

Co-authored-by: Brian Teeman <brian@teeman.net>

* Apply suggestions from code review

Code-style and language improvements.

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update language constants for plgSysScheduleRunner

Updates plugin description string.

* Bugfix Task::run()

For some reason, the UNIX timestamp with microseconds `microtime()`
broke the DateTime breaking down the task usual scheduling.
This commit introduces an int cast for the timestamp which makes things
work as expected.

* Fix webcron url & description

Fixes webcron url and description as exposed in the Scheduler component
config.

Ref: joomla-projects/soc21_website-cronjob#37

* Update joomla.asset.json

* Improve the locking mechanism

* Add table locking when locking task

* CS

* Simplify null date check

* Add column quote

* Extend TaskModel's getter method

! Fails in MySQL 5.6 with "Table <task table> was not locked with LOCK
  TABLES"

- Adds options array to customise behavior.
- Adds static option resolver for proxies to the getter.
- Wrap queue behavior in a sub-query for compatibility.
...

* Update Scheduler::getTask() and runTask()

Updates Scheduler::getTask() and Scheduler::runTask() to match
the updated TaskModel::getTask() method.

* Fix typos and improve static analysis support

Fixes some typos and adds some doc IDE typehint for improved
static analysis to the Scheduler class.

* Update/fix Schedulerunner

Updates primarily the Schedulerunner::runTestCron() method. Other
methods might need to be updated still.

* Update Task class

Minor updates, comments for the future.

* Update Task::releaseLock()

Fixes compatibility with PostgreSQL (tested on 11). Removes table
specificity from columns (this confuses Postgres for some reason).

* Update TaskModel::getTask()

Fixes task queue behavior (now only applies when an ID is not passed).

* Improve TaskModel::getTask() mysql compat

! Still fails because of table locks
- Adds pseudo-source for sub-query.
  https://stackoverflow.com/q/44970574
- Adds reference comments to try to make the
  SQL gymnastics make sense.

* Add unlock function

* Fix language strings for the schedulerunner plugin

* Update description and remove plugin files

* Implement Scheduler CLI state changer

* Update TasksStateCommand.php

* Fix list state filter in scheduler

* Fix MySQL lock violations

Fixes lock violation by getting rid of sub-queries.

* Fix label a11y [#42]

* Quote 'id'

Co-authored-by: Benjamin Trenkle <bembelimen@users.noreply.github.com>

* update publish/unpublish => enable/disable

* Add check for checked out tasks

Adds check for checked out state of tasks, so it doesn't silently fail
anymore if such a task is attempted to be updated.

* Improve static analysis support.

Adds type hints for classes so static analysis and IDE autocomplete
works better.

* Update exit codes and fix typos

- Updates failure exit codes so all are now distinct.
- Fixes typos and other minor things.
- Uses syntactic string composition instead of concatenation.

* Cleanup

Removes debug string eval

* Fix SQL scripts

Reduces length of `#__scheduler_tasks.type` to evade exceeding maximum
length of indices and considering 128 chars is sufficient for a UUID
and for context aware string currently used for routine IDs.

Refs: @HLeithner

* Apply Code-style and doc-block improvements from code review

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Replace Registry inheritance with composition

Task no longer extends Registry, but uses a new `taskRegistry` property
to store a Registry object. This compositional pattern makes the code
stink less.

* Refactor Task::isSuccess()

No longer takes care of dispatching exit events, which is done by
Task::dispatchExitEvent() now. Return API is unchanged.

* Apply Code-style and doc-block improvements from code review

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update doc-blocks for the Task driver

Adds doc-block for Task::EVENTS_MAP and updates the constructor's.

* Update composer.lock

* Update composer.lock

* Make Task property getter public [bug]

Makes the task property getter public. Protected visibility here
breaks things.

* Improve task routine exception handling

- The driver now allows for and preserves exceptions from routines,
throwing them again after wrapping things up and releasing the task
lock.
- Removes the nonNull assertion for the routine snapshot (this already
  did not work).

* Update plgScheduleRunner

Webcron now throws the exception from the task, if it exists. This is
caught by com_ajax and the exception message included in the output.

* Update Task::Status

Renames the KO_RUN status to KNOCKOUT, adds description in docblock.

* Fix exception handling in TaskPluginTrait

Catches only ReflectionExceptions now, leaving out others for the Task
driver to access.

* Cleanup assert exception refs

Cleans up imports and docblocks.

* Improve ScheduleRunner documentation.

* Improve code style

Majorly fixes from the latest updates in Joomla's PHP CS Fixer config,

* Fix demo task form

* Update language file for `com_scheduler`

* Use output buffering for lazyCron to avoid dying

* Merge update SQL

* Update plgTaskCheckfiles

- Adds support for WEBP.
- Better format support while resizing.
- Minor refactoring and more informative logging.

* Update scheduleRunner docs

* Improve code quality for task unlocking

- Improved static analysis support and type-hinting.
- Fix usage of undefined variables.
- Add/modify comments and variable names.
- Update event names and interface for relevance.
- Improve docs in doc-blocks.
- Fix code-style.

* Fix com_scheduler, task plugin code-style

Fixes code-style with the updated php-cs-fixer config.

* Fix WebcronLinkField::getLayoutPaths()

The union operator... did not do the right job.

* Merge more update SQL

Missed one!

* Rename update SQL

Updates date signatures of update files to a fresher date.

* Make plgTaskCheckfiles logging translatable

Adds language constants for logging strings.

Refs: @PhilETaylor

* Update plgTaskRequests

- Add logging on exception.
- Improve variable naming/file write safety.
- Update language file.

Refs: @PhilETaylor

* Improve exception handling plgTaskCheckfiles

- Improves handling exceptions and failures.
- Adds more informative logging.

Refs: @PhilETaylor

* Update code-style and language

- Fixes some misc code-style, reverses regression.
- Adds language for some log.

* Fix installation and update SQL scripts

* Fix update SQL for PostgreSQL for the database checker

* Add new core extensions to the extensions helper

* Add auto-install SQL for plg_task_checkfiles

- Adds auto-install SQL for both installation and update.
- Also adds relevant entry to ExtensionHelper.

Refs: joomla-projects/soc21_website-cronjob#49 / @richard67

* Add DB column for cli exclusive tasks

- Adds new DB column `#__scheduler_tasks.cli_exclusive`, updating both
  install and update scripts. Also adds relevant index.

* Add support for CLI exclusive tasks

- Updates TaskModel::getTask() with an option to include/exclude
  CLI exclusives.
- Adds runtime check to Scheduler::runTask() so it now includes CLI
  exclusives only in a CLI context.

* Add comments, fix doc signatures + style

- Add comments to schedulerunner.
- Fix some type signatures in doc-blocks.
- Other minor style fixes.

* Fix get request response body

Shouldn't throw an undefined constant again.

* Add `Scheduler::run()` option for concurrency

- Scheduler::run() now uses an options array backed by the Symfony
  OptionsResolver.
- Offers a new option that allows for execution concurrency (this was
  specifically required by the CLI command).

* Update plgSystemSchedulerunner

Updates Schedulerunner for changes in Scheduler::run()

* Make `scheduler:run` safer

- Null safety against Tasks.
- More informative stderr log on lock acquisition failures.
- Now allows concurrency so Web doesn't block out CLI anymore (thanks
  to the updates in Scheduler::run()).

Refs: joomla/joomla-cms#35143#issuecomment-976391914
      / @alikon
      / @bembelimen

* Refactor `scheduler:state`

- Better (expectedly safer) flow of logic with attempts to get the
  logical/enumerated state from command mode and interactive modes.
- Terminate on invalid command invocation.
- Fix exit success message (did not show action).
- Better formatting of description, etc.
- Code-style fixes.

Refs: joomla/joomla-cms#35143#issuecomment-977608144
      / @alikon
      / @bembelimen

* Improve `scheduler:run` description style

Minor improvement to `scheduler:run` description for consistency.

* Add utilities, bugfix Task class

- Adds state enumerations and map.
- Adds basic static state and id validators.
- Fix use of un-imported Text class, $->getMessage() call.

* Improve `scheduler:state` command

- Better validation and improved consistency.
- Removes now redundant state enumerations, mapping and validators
  which the Task class offers.

* Add page reload after testing

* Code sniffer fixes

* Rename param for Scheduler::fetchTaskRecord()

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>
Co-authored-by: Benjamin Trenkle <benjamin.trenkle@wicked-software.de>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Benjamin Trenkle <bembelimen@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
2021-11-26 12:42:10 +01:00
Allon Moritz 379895ccd9
[4.1] Media webservice (#35788)
* [4.0] Notification icons (#34226)

* remove method allow parent to run (#34118)

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

* [4.0] Changing title to tooltip for template preview (#33292)

* [4.0] Changing title to tooltip fpr template preview

* Update location path in description (#34238)

* Fix patterns field check when field empty and not required (#34124)

* [4.0] Finish transition from CSS classes "label-" to "alert-" for the pre-update check (#34227)

* [4.0] mod_popular with disabled hits (#34257)

* [4.0] mod_popular with disabled hits

When hits are disabled for articles it makes no sense to display the Most Read Articles module in the site or admin as the contents will never be updated.

This PR changes the output of the module so that instead of a list of non-updating articles a message is displayed.

* [4.0] Use MVCFactory to create model (#34092)

* Use MVCFactory to create models

* CS

* Fix row selecting, when module is disabled (#34273)

* Media web service implementation.

* Media web service implementation.

* Fix hard coded adapter name default.

* Fix missing url and tempUrl attributes in single item response.

* Remove useless comments.

* Replace 'PATH' with 'STRING' for cleaning of input parameters.

* Adds required parameter checks and removes global exception handling.

* Adds media web service specific language strings.

* Adds exception handling.

* Adds missing exception handler and fixes wrong path return value after move/rename.

* Use exception message as error title.

* Adds proper FileNotFound exception handling for GET requests.

* Fixes handling of status code.

* Fixes some types, formatting and similar stuff.

* Fixes yet another sloppy typo.

* restore file

* Fix some docs

* Adapter endpoint

* Add plugin to install file

* Add tests

* Update api/components/com_media/src/Helper/MediaHelper.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Helper/MediaHelper.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Model/MediaModel.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Model/MediumModel.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/View/Media/JsonapiView.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update libraries/src/Error/JsonApi/SaveExceptionHandler.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Controller/MediaController.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Controller/MediaController.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Model/AdaptersModel.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update api/components/com_media/src/Model/MediaModel.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* docs

* Update api/components/com_media/src/View/Media/JsonapiView.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* int

* cs

* cs

* more cleanup

* tabs

* restore

* Test all endpoints

* Update api/components/com_media/src/Model/MediaModel.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Hardening

* Tests fix for drone

* Update Api.php

* Create directory in test with correct permissions

* Add more tests and remove static helper

* Update tests/Codeception/api/com_media/MediaCest.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* Update tests/Codeception/_support/Helper/Api.php

Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>

* cs

Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Phil E. Taylor <phil@phil-taylor.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: infograf768 <infografjms@gmail.com>
Co-authored-by: Quy <quy@fluxbb.org>
Co-authored-by: Ruud <info@onlinecommunityhub.nl>
Co-authored-by: Tuan Pham Ngoc <github@joomdonation.com>
Co-authored-by: Fedir Zinchuk <getthesite@gmail.com>
Co-authored-by: Pieter-Jan de Vries <pieter@obix.nl>
2021-11-23 20:20:07 +01:00
Richard Fath f7bafef9e6
[4.0] Fix notice about duplicate joomla/mediawiki in composer.json when running composer install (#35974)
* Remove duplicate joomla/mediawiki in composer.json

* Update lock file too
2021-11-07 19:49:44 +00:00
Jelle Kok 572951ab82
[4.0] php-cs-fixer v3.0 Support (#33908) 2021-11-01 23:54:05 +00:00
wilsonge dd22c22c85
Mediawiki stable 2021-08-16 21:45:02 +01:00
wilsonge 020736c15a
Stable framework 2021-08-16 21:14:32 +01:00