Comments (6)
Hm, I've tried it also in fresh nette project and the decorator was called as expected. So it will be probably in some other place, sorry for the issue.
from di.
It may be related to presenters being automatically registered as services (optionally). I guess your presenter is created in runtime and so does not exist in generated DIC and DecoratorExtension can't apply its setup.
Simplest way to fix it is register presenter as a service manually. Otherwise you will have to debug, why your presenter is not found by ApplicationExtension
from di.
Thanks for your answer! Yes, you are right, if I register e.g. HomepagePresenter
, the decorator is finally called. But I don't understand why it worked before the update. 🤷♂️
Also, not sure what to do when I need to decorate abstract presenter. Do I have to list all of the child presenters? Maybe some GTMConfig
service holding the boolean and passed to abstract presenter would be better then I guess..
from di.
Did you also update nette/application? Or do you have application:
options like scanComposer, scanFilter, scanDir set?
Do I have to list all of the child presenters?
Yes, decorator works with service definitions, each presenter must be available as a service.
from di.
Did you also update nette/application?
No
Or do you have application: options like scanComposer, scanFilter, scanDir set?
Yes, scanDirs: false
from di.
There was probably some perf improvement in nette/di which caused that decorating unscanned presenters stopped working. It makes sense actually when I chose not to scan for presenters. 🙂 Did forget about that setting.
from di.
Related Issues (20)
- Malfunctioning use of variadic arguments in combination with autowired HOT 1
- Multifactory does not work
- Dynamic parameter does not work in static parameter HOT 27
- SearchExtension: compatible with trait Nette\StaticClass HOT 1
- Parent method with static type, has a badly evaluated return type for factory method in container
- Compiler error in process schema after update to 3.1.4 HOT 2
- Circular reference detected for variables HOT 5
- wrong inject of variables after update 3.1.6 > 3.1.7 HOT 3
- "ERROR: Circular reference detected for:" instead of creating Service with array of strings as parameters HOT 5
- Nette\DI\Config\Loader::load($filePath) loads string parameter '@12345' as string '@@12345' HOT 3
- Parameters defined using function notation in neon config not available when calling getParameter HOT 4
- Support `new` in initializers HOT 1
- Some releases were deleted HOT 1
- Calling ReflectionMethod::__construct() with 1 argument is deprecated in PHP 8.4
- Nette DI: suspicious dumping of objects when generating the container HOT 8
- "Object of class DateTimeImmutable could not be converted to string" after update to 3.2.0
- DI Extensions can not use parameters from app main configuration HOT 8
- Parameter removed if static method referenced [BC break] HOT 4
- Parameters in includes
- ReflectionException: Method Nette\DI\Container::createServiceFromStaticFactory() does not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from di.