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

Drop useless framework initialization #4346

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

m-vo
Copy link
Member

@m-vo m-vo commented Mar 22, 2022

/cc @ausi

@leofeyer leofeyer added the bug label Mar 22, 2022
@leofeyer leofeyer added this to the 4.13 milestone Mar 22, 2022
@leofeyer
Copy link
Member

Are you sure that the initialization is useless? The method gets a Contao\Template object which likely does not work without the Contao 3 framework.

@fritzmg
Copy link
Contributor

fritzmg commented Mar 22, 2022

I think the idea is that the getResponse method gets object instances of legacy classes and thus the framework must be initialized already beforehand.

@leofeyer
Copy link
Member

Sounds like a "don‘t rely on your dependencies‘ dependencies" situation. 🤷‍♂️

@fritzmg
Copy link
Contributor

fritzmg commented Mar 25, 2022

But then we would also need to inject and initialize the ContaoFramework in every Hook that uses any legacy class - which we currently do not do.

@m-vo
Copy link
Member Author

m-vo commented Mar 25, 2022

I don't think a method is responsible for initializing the arguments, the caller is. But up to you. In Contao 5 things will be a bit different anyway.

@leofeyer leofeyer merged commit 8e7c538 into contao:4.13 Mar 28, 2022
@leofeyer
Copy link
Member

Thank you @m-vo.

@m-vo m-vo deleted the bugfix/drop-useless-framework-init branch July 5, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants