? ? Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
4 Jun 2022

Summary of Changes

  1. events_map property moved from FormModel to BaseDatabaseModel because the property is shared by multiple inheritors.
  2. All eventClass params of AbstractEvent::create() calls are shortened to use Classname::class notation instead of using string event classname (easier to find all event class usages vide IDE in 2022).
  3. onAfterDisplay event can modify the output now.
  4. New ListQueryEvent class and onContentListQuery event to modify the list query before executing.
  5. New AfterGetListEvent class and onContentAfterGetList event to modify the list of items after load from database.

Testing Instructions

  1. Apply patch, try to play with custom events via your plugin, i.e.
		// All views return 'my custom HTML'
		public function onAfterDisplay(DisplayEvent $event)
		{
			$event->setArgument('source', 'my custom HTML');
		}

		// All lists are ordered by `a.id`
		public function onContentListQuery(DisplayEvent $event)
		{
			$event->getArgument('query')->order('a.id');
		}

		// All lists' titles are 'OK'
		public function onContentAfterGetList(AfterGetListEvent $event)
		{
			foreach($event->getArgument('list') as $item)
			{
				$item->title = 'OK';
			}
		}

Actual result BEFORE applying this Pull Request

Core Joomla is barely extendable.

Expected result AFTER applying this Pull Request

Core Joomla is extendable.

Documentation Changes Required

No.

ac7525f 4 Jun 2022 avatar Denitz fix
avatar Denitz Denitz - open - 4 Jun 2022
avatar Denitz Denitz - change - 4 Jun 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jun 2022
Category Administration com_content com_installer com_modules com_plugins Libraries Front End Plugins
avatar brianteeman
brianteeman - comment - 4 Jun 2022

Is this backwards compatible?

avatar Denitz
Denitz - comment - 4 Jun 2022

Is this backwards compatible?

@brianteeman Yes, it only adds the new functionality. I can add the same code in Joomla 3 but won't be accepted :)

avatar richard67
richard67 - comment - 4 Jun 2022

@Denitz New functionality should go into 4.2, if backwards compatible. So this PR should be rebased to the 4.2-dev branch. Let us know if you need help with that.

After rebase, the PR might show unrelated changes on GitHub, but that will go away after the next update of the 4.2-dev branch with the latest changes on the 4.1-dev branch (so-called "upmerge") and after that an update of your branch for this PR to the latest 4.2-dev here.

251cd49 4 Jun 2022 avatar Denitz fix
avatar Denitz Denitz - change - 4 Jun 2022
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jun 2022
Category Administration com_content com_installer com_modules com_plugins Libraries Front End Plugins Unit Tests Repository Administration com_admin SQL
3adc6a6 4 Jun 2022 avatar Denitz fix
4e51834 4 Jun 2022 avatar Denitz fix
avatar Denitz Denitz - change - 4 Jun 2022
Labels Added: ?
avatar Denitz
Denitz - comment - 4 Jun 2022

@richard67 Rebased

avatar richard67 richard67 - change - 4 Jun 2022
Labels Added: ?
Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jun 2022
Category Administration Unit Tests Repository com_admin SQL Administration com_content com_installer com_modules com_plugins Libraries Front End Plugins
avatar Denitz Denitz - change - 5 Jun 2022
Labels Removed: ?
avatar Denitz
Denitz - comment - 5 Jun 2022

Drone fails because xmlreader is not installed for PHP 8.1, can somebody fix it?

avatar richard67
richard67 - comment - 5 Jun 2022

Drone fails because xmlreader is not installed for PHP 8.1, can somebody fix it?

Have contacted maintainers to check.

avatar Denitz
Denitz - comment - 7 Jun 2022

Is it possible to restart drone?

avatar richard67
richard67 - comment - 7 Jun 2022

Is it possible to restart drone?

@Denitz I have done that recently a few times, but the tests fail all at the same step: Logging in to admin after a new installation. Have you tested this yourself, making a new installation with your PR applied, and then logging in to backend? I'll restart drone now but I do not really expect new results.

1d88b6d 7 Jun 2022 avatar Denitz fix
avatar HLeithner
HLeithner - comment - 13 Jun 2022

There is a reason why we don't have a listquery event because it creates more then it solves. This has discussed several times.

Also the modification of the result is questionable. Because we easily generate more problems then expected.

avatar Denitz
Denitz - comment - 14 Jun 2022

Please remove the new Events for query manipulation, this has been discussed several times for more information look at #26179

Sorry and thanks for your time. The query manipulation was the main feature of this PR.

avatar Denitz Denitz - close - 14 Jun 2022
avatar Denitz Denitz - close - 14 Jun 2022
avatar Denitz Denitz - change - 14 Jun 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-06-14 08:43:46
Closed_By Denitz
avatar laoneo
laoneo - comment - 14 Jun 2022

Would you mind to open a new pr which removes the hard codec class paths?

avatar Denitz
Denitz - comment - 15 Jun 2022

I removed onContentListQuery event, though I totally disagree.

avatar Denitz Denitz - change - 15 Jun 2022
Status Closed New
Closed_Date 2022-06-14 08:43:46
Closed_By Denitz
avatar Denitz Denitz - change - 15 Jun 2022
Status New Pending
avatar Denitz Denitz - reopen - 15 Jun 2022
avatar joomla-bot
joomla-bot - comment - 27 Jun 2022

This pull requests has been automatically converted to the PSR-12 coding standard.

avatar HLeithner HLeithner - change - 27 Jun 2022
Labels Added: ?
avatar Denitz Denitz - change - 2 Jul 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-07-02 10:10:38
Closed_By Denitz
avatar Denitz Denitz - close - 2 Jul 2022

Add a Comment

Login with GitHub to post a comment