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

Pass mauticTemplateVars to twig templates #13257

Merged
merged 3 commits into from Jan 25, 2024

Conversation

kuzmany
Copy link
Member

@kuzmany kuzmany commented Jan 20, 2024

Q A
Bug fix? (use the a.b branch) [ ]
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 #...

Description:

Follow up of #12924

Seems like customContent twig function does not work because pass not existed mauticTemplateVars.

       ` {{ customContent('tabs.content', mauticTemplateVars|default([])) }}`

This PR inject mauticTemplateVars to twig templates, similar like we did in M4

Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Just test your own subscriber to contact detail page tab content. After PR should work properly
  public static function getSubscribedEvents()
    {
        return [
            CoreEvents::VIEW_INJECT_CUSTOM_CONTENT => ['injectViewCustomContent', 0],
        ];
    }

    public function injectViewCustomContent(CustomContentEvent $customContentEvent): void
    {
        if ('tabs.content' == $customContentEvent->getContext()) {
            
        }
    }

@kuzmany kuzmany marked this pull request as ready for review January 20, 2024 18:07
@kuzmany kuzmany added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test labels Jan 20, 2024
Copy link

codecov bot commented Jan 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bee6b30) 58.60% compared to head (da6a901) 58.60%.
Report is 4 commits behind head on 5.0.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                5.0   #13257      +/-   ##
============================================
- Coverage     58.60%   58.60%   -0.01%     
  Complexity    32985    32985              
============================================
  Files          2183     2183              
  Lines         98756    98755       -1     
============================================
- Hits          57877    57875       -2     
- Misses        40879    40880       +1     
Files Coverage Δ
...bundles/CoreBundle/Controller/CommonController.php 79.37% <100.00%> (+0.09%) ⬆️
...p/bundles/CoreBundle/Twig/Helper/ContentHelper.php 72.22% <100.00%> (-7.78%) ⬇️

Copy link
Member

@mabumusa1 mabumusa1 left a comment

Choose a reason for hiding this comment

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

Tested, changes are correct

@kuzmany kuzmany added 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 Jan 20, 2024
@kuzmany
Copy link
Member Author

kuzmany commented Jan 22, 2024

@mollux , please consider adding this to version 5.0.3. It blocks third-party plugins.

@escopecz escopecz added this to the 5.0.3 milestone Jan 25, 2024
Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

I see no issue here 👍

@escopecz escopecz merged commit 527d684 into mautic:5.0 Jan 25, 2024
13 of 14 checks passed
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 pending-test-confirmation PR's that require one test before they can be merged
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants