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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade Loader to use renamed Twig\TwigFunction #2327

Merged
merged 1 commit into from
Oct 5, 2020
Merged

Conversation

acobster
Copy link
Collaborator

If WP_DEBUG is disabled, a Fatal Error will be thrown: "Class 'Timber\Twig_Function' not found". This just fixes the name so we're using the right class.

Issue

I'm just starting to integrate our budding 2.x alpha on a real project, and this is the first thing I ran into. Looks like a code path that's probably not covered by the tests, but I don't have time to figure out how to test using different constants. But the fix is about as simple as it gets.

Solution

use the correct Twig\TwigFunction class within Loader.

Impact

The thing will work now! 馃槃

Usage Changes

None

Considerations

How can we test this reliably? Is it worth it?

Testing

None for now.

If `WP_DEBUG` is disabled, a Fatal Error will be thrown: "Class 'Timber\Twig_Function' not found".
This just fixes the name so we're using the right class.
@jarednova
Copy link
Member

d'oh! Great find. In terms of testing: unfortunately, there's no easy way to enable/disable PHP constants once they've been set. I banged my head against a wall for awhile trying to get things going with PECL / Runkit at one point. But after the bleeding stopped, I was no closer. I'll let @gchtr take a formal look at this, but my vote is to fix the problem and make testing against WP_DEBUG (or other constant considerations) a future @todo

Copy link
Member

@gchtr gchtr 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! 馃憤

@jarednova I鈥檒l leave it to you to create an issue for a future todo about testing with WP_DEBUG.

@acobster acobster merged commit 1b1618c into 2.x Oct 5, 2020
@gchtr gchtr deleted the 2.x-rename-twig-fn branch November 2, 2020 20:06
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