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

M3: Refactor builder token helper #8204

Merged
merged 20 commits into from Dec 19, 2019
Merged

M3: Refactor builder token helper #8204

merged 20 commits into from Dec 19, 2019

Conversation

mtshaw3
Copy link
Contributor

@mtshaw3 mtshaw3 commented Dec 9, 2019

\Mautic\CoreBundle\Helper\BuilderTokenHelper is dependent on MauticFactory and thus needs to be refactored to a service instead in order to use dependency injection.

This PR replaces the broken PR that was rebased to the 3.x branch: #8160

GH issue: #8088

@mtshaw3 mtshaw3 changed the title Refactor builder token helper M3: Refactor builder token helper Dec 9, 2019
@mtshaw3 mtshaw3 added code-review-needed PR's that require a code review before merging Mautic 3 labels Dec 9, 2019
@escopecz escopecz added the ready-to-test PR's that are ready to test label Dec 10, 2019
@escopecz escopecz added this to the 3.0.0 milestone Dec 10, 2019
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.

Good idea with the factory. I noticed some issues.

app/bundles/FormBundle/EventListener/PageSubscriber.php Outdated Show resolved Hide resolved
app/bundles/FormBundle/EventListener/PageSubscriber.php Outdated Show resolved Hide resolved
app/bundles/LeadBundle/Config/config.php Outdated Show resolved Hide resolved
app/bundles/LeadBundle/EventListener/EmailSubscriber.php Outdated Show resolved Hide resolved
app/bundles/PageBundle/EventListener/BuilderSubscriber.php Outdated Show resolved Hide resolved
@escopecz escopecz added the pending-feedback PR's and issues that are awaiting feedback from the author label Dec 10, 2019
@mtshaw3 mtshaw3 removed the pending-feedback PR's and issues that are awaiting feedback from the author label Dec 10, 2019
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.

Thanks! I reviewed again and suggested small improvements.

app/bundles/CoreBundle/Helper/BuilderTokenHelper.php Outdated Show resolved Hide resolved
app/bundles/CoreBundle/Helper/BuilderTokenHelper.php Outdated Show resolved Hide resolved
plugins/MauticFocusBundle/EventListener/PageSubscriber.php Outdated Show resolved Hide resolved
@escopecz escopecz added the pending-feedback PR's and issues that are awaiting feedback from the author label Dec 12, 2019
@mtshaw3 mtshaw3 changed the title M3: Refactor builder token helper M3: Refactor builder token helper Dec 13, 2019
@dongilbert
Copy link
Member

Something is causing this error when I'm walking through testing.

[2019-12-13 20:50:06] mautic.CRITICAL: Uncaught PHP Exception Doctrine\Common\Persistence\Mapping\MappingException: "Class 'asset' does not exist" at /Users/dgilbert/Dev/mautic/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php line 96 {"exception":"[object] (Doctrine\\Common\\Persistence\\Mapping\\MappingException(code: 0): Class 'asset' does not exist at /Users/dgilbert/Dev/mautic/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:96)"} []

I wanted to create a new Page so that the I could test the builder tokens are being inserted into the builder correctly, but when clicking the new button on the page list view, it failed to load the form and instead dumped this error into the logs.

@dongilbert
Copy link
Member

We need to update the BuilderTokenHelperFactory as well - https://github.com/mautic/mautic/pull/8204/files#diff-966ddd047b8bdaf985231305e091f415R525

@escopecz escopecz removed the pending-feedback PR's and issues that are awaiting feedback from the author label Dec 18, 2019
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.

Looks good and works well. I tested page builder and email builder. Tokens are being replaced when sent to contacts. Thanks @mtshaw3 👍

@escopecz escopecz merged commit 0806cbd into mautic:m2-to-m3 Dec 19, 2019
@escopecz escopecz removed code-review-needed PR's that require a code review before merging ready-to-test PR's that are ready to test labels Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants