Add plugin events to com_contact (redo)#8024
Add plugin events to com_contact (redo)#8024Harmageddon wants to merge 15 commits intojoomla:stagingfrom
Conversation
Step 1: com_contact
Conflicts: components/com_contact/views/categories/view.html.php components/com_contact/views/category/view.html.php components/com_contact/views/contact/view.html.php layouts/joomla/content/category_default.php
|
Updated the PR with Beez support and a slightly different context for category descriptions. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8024. |
|
Thankyou :) I'll try and find some time to test over the next week or so. But can't guarantee anything :( |
|
Testing works! This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8024. |
|
I have tested this item ✅ successfully on ccb17b0 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8024. |
|
@test works for me too. Also saw some improvements. Thanks for that! |
|
I have tested this item ✅ successfully on ccb17b0 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8024. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8024. |
|
@Harmageddon can you fix the merge conflicts. |
|
This PR has received new commits. CC: @KlausKrippeit, @Rivaner, @yvesh This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8024. |
|
@zero-24 Should be fine now. |
|
Thanks @Harmageddon |
|
Thanks everybody, this has now been merged into 3.5-dev with commit 88fb40b Gosh what a brainkiller this was to merge :P |
|
This pull request has introduced two regressions:
|
|
@mbabker You know what comes. Can you open a new issue (or even PR) that references to this PR? |
|
#8581 PR for the context (part 2). Don't have time right at this second to look into number 1. Will do that later. |
If I do it's taking the event triggers out of This pull request should not have been merged without testing against ALL components because of the changes in JViewCategory at a minimum. Also, the actual merge for this pull request (commit 88fb40b) is so vastly different than the state this pull request was accepted in at this point I would practically demand that the original merge be reverted and the merge attempted again without all the extra changes (compare the changes for components/com_contact/views/contact/tmpl/default.php from this pull request with the committed changes. The diffs for these files alone do not align, not to mention the number of files changed in this pull request compared to the actual merge. |
|
Any update on best way to fix the double event triggering ?
Also 3 out of the 4 triggers are using ->core_params which does not exist https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/view/category.php#L161-L168 Regarding the empty parameters, there is a report for it here: |
|
ok, my comment about 3rd party extensions is mostly wrong, only a very small number (if any) will need to be updated because function commonCategoryDisplay which got the new code to trigger plugin event is inside JViewCategory and not inside JViewLegacy, and then double triggering is only if you call parent::commonCategoryDisplay(); |
|
I'm so sorry I forgot about this. I'm out today but will try and get back on this either this evening or tomorrow. Please ping me repeatedly on this if it feels like I've forgotten about the issue! |
|
Besides fixing $itemElement->core_params (which does not exist) to be ->params A simple and clean fix for the double category triggering is
public function commonCategoryDisplay() at libraries/legacy/view/category.php (class JViewCategory) so as to be: public function commonCategoryDisplay($trigger_events=false) Then update views that extend JCategoryView (and that also call commonCategoryDisplay) and for which default code for triggering events is good enough: And then views that need a custom preparation for plugin event triggering and want to do it inside their own code: |
|
Also since plugin event trigger was added to the parent class (JViewCategory),
otherwise it is rather inflexible, and any view wanting to do some extra preparation for plugin event triggering will need to skip the commonCategoryDisplay altogether and copy all its code inside the current view plus it becomes background compatible |
|
Testing beta 2 this is still an issue #8963 |
@wilsonge Pinging you as the discussion is still on-going. |
|
Testing on latest staging double event triggering is still an issue see backbutton/content-plugin#6 |
|
@wilsonge Pingig you regardig double event triggering. |
|
Thankyou! I have left this up on my laptop and will have code to fix it on the way home from work this evening! |
|
Fixed with fb4d375 |
This is a redo of #3630, using the current staging branch and with some improvements.
Contents
This PR implements the following plugin events for plugins (group: content):
Testing instructions
You can either write a new one, modify one of the existing content plugins, or use this small plugin for testing purposes.