Active
Project:
Drupal core
Version:
main
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Feb 2023 at 23:02 UTC
Updated:
2 Aug 2024 at 11:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andypostFiled CR https://www.drupal.org/node/3344579
patch initial attempt, looks better to introduce a trait for that like
DeprecatedServicePropertyTraitComment #3
longwave+1 to adding a DeprecatedPropertyTrait similar to the service one, if we are going to do this everywhere in Views.
Comment #4
andypostThanks! The only trick is that trait will provide only one link to change record but maybe it should be enough
Comment #5
longwaveMaybe $deprecatedProperties can include the change record ID? Something like:
Comment #6
andypostGuess kinda it
Comment #7
andypostproperty should not be defined in trait
Comment #8
lendudeFeel useful outside Views to maybe? Currently not doing anything that would make this Views only, so maybe move it somewhere more generic?
Maybe expand on this that the 'deprecatedProperties' property must be set on all classes that implement this trait?
'Allows throwing an exception when a property is accessed that has been marked as deprecated.'
This bit is only in __get not __set, shouldn't it be in both?
Hardcoding the Drupal version means we can't use this in 10.2 without existing deprecation messages also changing, so I think that needs to be dynamic as well
Comment #9
quietone commentedI only found this issue because I was checking if there were any issues filed on Drupal 8. I am changing the version to 10.
So, this issue is scoped by file but we now make coding standard fixes by sniff and with a different scope. That would make this issue a won't fix. For reference, the issue for the relevant sniff is #2937514: Fix Drupal.NamingConventions.ValidVariableName.LowerCamelName in tests.
But this issue is also proposing a way to deprecate properties. I think that should be discussed in it's own issue and work on the above issue is postponed on that. What do you think?
Comment #10
larowlanNeat!
any reason not to put deprecatedProperties on the trait and make it empty?
I assume to prevent using the trait by accident?
What if it is deprecated in 10.2.0? Do we need more than $property and $link? Should we have a simple value object?
of
Comment #11
rishabh vishwakarma commentedAddressed #10.3
Comment #13
quietone commentedComment #14
quietone commented