-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
[RFC] Thoughts on deprecating all methods on the Content object #6985
Comments
As I raised in #6774 and have become pretty firm on, I think your suggestions here reflect a good way to go. I am not fussed if they are filters, functions, or both. But there absolutely needs to be a way forward now so, as you said, there is less work/surprise in the future for people. |
Also related #6798. In combination with Twig. |
This issue has been automatically marked as stale because it has not had recent activity. Maybe this issue has been fixed in a recent release, or perhaps it is not affecting a lot of people? |
@bobdenotter @GawainLynch @rossriley @CarsonF did we land on the |
I am going to be working on this for 3.5, have a branch in progress now so happy to close this. Can't remember what was discussed about the explain filter what did we decide? |
IIRC the compromise plan that everyone was okay with was to have a I'm pretty sure @CarsonF and me talked about implementation details, but those are lost to the slack-iverse. |
I was initially pretty much against deprecating them. Unless we have an alternative that is. So, let's deprecate them, if we can provide users with a way to still "dump" the entire contents of a record, to see what's in it.. Thinking out loud, would Also, it'd be great if we can extend this to work for multiple records: |
@bobdenotter Yeah, the idea was for We had a discussion in slack about naming and I think there was some argument against |
This issue has been automatically marked as stale because it has not had recent activity. Maybe this issue has been fixed in a recent release, or perhaps it is not affecting a lot of people? |
Ok, well the initial part of this is completed, in 3.x .previous .next .editlink etc will still all work on entities but they forward to twig filters and functions and thus this can become the official way as of 4.0. Not sure on what we want the spec for the |
This may not be desirable or doing it now for deprecation in 4.0 might be deemed to be too hasty so I'm just interested in getting some general feedback before I start working on anything.
As you know I'm working on the compatibility between old and new storage layers and one of the biggest jobs is making sure that a new content object behaves as similarly as possible to an old one.
One of the downsides of this is that these content objects need to know too much and do too much and if we want to improve things in the future I'm suggesting that we standardise our public Twig API on functions and filters rather than having core functionality mixed into the content objects themselves.
The other part is that it's very hard to determine what is and what isn't the public API and ideally when 4.0 hits we want to reduce the number of surprises as people migrate their themes over.
So the main methods to address are:
Also perhaps have a pass through the classes and traits and mark unnecessarily public methods as protected.
The idea would be to provide this functionality via functions or filters where applicable and these can then have the correct dependencies injected into them.. for example something like...
Obviously these are just initial suggestions and details can be hammered out in implementation phase.
Thoughts / alternative ideas welcome.
The text was updated successfully, but these errors were encountered: