Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding VIEW_INJECT_CUSTOM_TEMPLATE back even in the Twig world #12924

Merged

Conversation

escopecz
Copy link
Sponsor Member

@escopecz escopecz commented Nov 24, 2023

Q A
Bug fix? (use the a.b branch) [y]
New feature/enhancement? (use the a.x branch) [ ]
Deprecations? [ ]
BC breaks? (use the c.x branch) [ ]
Automated tests included? [ ]
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#...
Issue(s) addressed Fixes https://forum.mautic.org/t/what-is-mautic-5-way-of-injecting-custom-templates/29846/2

Description:

The CoreEvents::VIEW_INJECT_CUSTOM_TEMPLATE event used to be in the PhpEngine but was removed together with it.

I found another place to put it to work as before even with the twig templates.

The IntegrationBundle actually used that event to display object mapping on the contact detail page, so that was broken.

Steps to test this PR:

  1. This cannot be easily tested. You'd need a plugin built on top of the IntegrationsBundle and then have a Mautic contact mapped to some integration object. But I've added a functional test that confirms the mapping object is visible on the contact detail page if some mapping exists. Since the CoreEvents::VIEW_INJECT_CUSTOM_TEMPLATE event was removed together with the PhpEngine, this functionality stopped working.

@mautibot
Copy link

This pull request has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/what-is-mautic-5-way-of-injecting-custom-templates/29846/3

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #12924 (ecda012) into 5.x (42c566d) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                5.x   #12924      +/-   ##
============================================
+ Coverage     58.81%   58.85%   +0.03%     
- Complexity    33627    33628       +1     
============================================
  Files          2181     2181              
  Lines        101821   101826       +5     
============================================
+ Hits          59889    59925      +36     
+ Misses        41932    41901      -31     
Files Coverage Δ
...bundles/CoreBundle/Controller/CommonController.php 80.08% <100.00%> (+0.44%) ⬆️

... and 3 files with indirect coverage changes

@escopecz escopecz marked this pull request as ready for review November 24, 2023 15:38
@escopecz escopecz added regression A bug that broke something in the last release bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test plugin Anything related to plugins code-review-needed PR's that require a code review before merging labels Nov 24, 2023
@escopecz escopecz added this to the 5.0-General Availability milestone Nov 24, 2023
@escopecz escopecz force-pushed the fixing-VIEW_INJECT_CUSTOM_TEMPLATE-event branch from c87fc08 to ecda012 Compare November 24, 2023 15:44
@mautibot
Copy link

This pull request has been mentioned on Mautic Forums. There might be relevant details there:

https://forum.mautic.org/t/post-thanksgiving-boost-contribute-to-mautic-this-open-source-friday/30038/1

@mzagmajster
Copy link
Contributor

Hi @escopecz ,

I just did the basic test on this and it works OK. When I adjust the actual plugin and test it, I will make a review here.

image

You did something very valuable here, thank you.

@escopecz escopecz added user-testing-passed PRs which have been successfully tested by the required number of people. pending-test-confirmation PR's that require one test before they can be merged and removed ready-to-test PR's that are ready to test labels Nov 28, 2023
Copy link
Member

@kuzmany kuzmany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works. Nice

@kuzmany kuzmany added ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed pending-test-confirmation PR's that require one test before they can be merged labels Nov 28, 2023
@escopecz escopecz removed the code-review-needed PR's that require a code review before merging label Nov 28, 2023
@escopecz escopecz merged commit 1af09c2 into mautic:5.x Nov 28, 2023
14 checks passed
@mzagmajster
Copy link
Contributor

you beat me to the review, kuzmany, thanks.

@escopecz escopecz deleted the fixing-VIEW_INJECT_CUSTOM_TEMPLATE-event branch November 30, 2023 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs plugin Anything related to plugins ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged regression A bug that broke something in the last release user-testing-passed PRs which have been successfully tested by the required number of people.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants