You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the normalize() method in ArticleController is declared as private. This prevents developers from overriding or extending it in their own controllers when they need to handle nested fields (for example, accessing excerpt.categories[0].name). As a result, we have to copy the entire cgetAction and replicate the exact logic, just to inject a small piece of custom field processing.
Expected Behavior
It would be ideal if the normalize() method (or at least the portion of the code that processes fields) could be made protected, or if there was another extension point (e.g., an event/hook) allowing developers to handle nested fields without needing to duplicate the logic from the parent class.
Steps to Reproduce
Extend ArticleController in a custom bundle.
Attempt to override normalize() to handle nested data.
Notice that normalize() is private, so it cannot be called or overwritten from the child class.
The only workaround is to duplicate a large portion of the parent method (e.g., cgetAction) and replace the normalize call.
Possible Solutions
Make normalize() protected: This would allow child classes to override and add custom logic.
Add a dedicated extension point or event: So that nested fields can be handled without copying the whole controller action.
Support multi-level field descriptors: For instance, a field descriptor could point to excerpt.categories.0.name, and the code could parse that path internally.
Thank you for considering this enhancement. If you have any questions or suggestions, please let me know!
The text was updated successfully, but these errors were encountered:
Actual Behavior
Currently, the
normalize()
method inArticleController
is declared asprivate
. This prevents developers from overriding or extending it in their own controllers when they need to handle nested fields (for example, accessingexcerpt.categories[0].name
). As a result, we have to copy the entirecgetAction
and replicate the exact logic, just to inject a small piece of custom field processing.Expected Behavior
It would be ideal if the
normalize()
method (or at least the portion of the code that processes fields) could be madeprotected
, or if there was another extension point (e.g., an event/hook) allowing developers to handle nested fields without needing to duplicate the logic from the parent class.Steps to Reproduce
ArticleController
in a custom bundle.normalize()
to handle nested data.normalize()
isprivate
, so it cannot be called or overwritten from the child class.cgetAction
) and replace thenormalize
call.Possible Solutions
normalize()
protected: This would allow child classes to override and add custom logic.excerpt.categories.0.name
, and the code could parse that path internally.Thank you for considering this enhancement. If you have any questions or suggestions, please let me know!
The text was updated successfully, but these errors were encountered: