Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Part of meta-issue #1856630: [Change notice] [META] Rename Views methods to core standards
Comment | File | Size | Author |
---|---|---|---|
#19 | 2002934-19.patch | 6.5 KB | damiankloip |
#19 | interdiff-2002934-19.txt | 4.79 KB | damiankloip |
#15 | 2002934-15.patch | 6.45 KB | damiankloip |
#15 | interdiff-2002934-15.txt | 3.63 KB | damiankloip |
#12 | rename_views_method_validate_argument-2002934-2.patch | 3.83 KB | drupee |
Comments
Comment #1
x.algorithm CreditAttribution: x.algorithm commentedI'll take this on!
Comment #2
x.algorithm CreditAttribution: x.algorithm commented3 Files were changed.
Each function renamed as requested.
I believe it should solve the problem.
Please review
Comment #3
x.algorithm CreditAttribution: x.algorithm commentedComment #4
kevin.reiss CreditAttribution: kevin.reiss commentedAdded public keyword to methods, and removed an arguement name change from simpletest file,
Comment #5
kevin.reiss CreditAttribution: kevin.reiss commentedThere appears to be two "validateArgument()" methods defined in core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php.
Comment #6
kevin.reiss CreditAttribution: kevin.reiss commentedCurrently the following two methods are defined in core/modules/views/lib/Drupal/views/Plugin/views/argument/ArgumentPluginBase.php.
Starting on line 941:
Before the second one (validate_argument) is camel cased it should be renamed so it won't conflict with the existing validateArgument method.
Comment #7
kevin.reiss CreditAttribution: kevin.reiss commentedComment #8
heddnLet's try another pass at this. This should catch (hopefully) all the re-names.
Comment #10
drupee CreditAttribution: drupee commentedReplaced function name and removed syntax error.
Comment #11
drupee CreditAttribution: drupee commentedPlease ignore previous patch.
Comment #12
drupee CreditAttribution: drupee commentedI just noticed validateArgument is already present in ArgumentPluginBase.php for some other reason (to double check and get sure of argument).
According to me it's matter of choice which one to be renamed.
But I guess the one which is made for menu systems should be like it is. So I left it, rest are renamed, tried test on local, passed.
Comment #13
drupee CreditAttribution: drupee commentedComment #15
damiankloip CreditAttribution: damiankloip commentedI think a couple of conversions were missed outside of the views module, also, I think making the menu method validateMenuArgument is a good idea. We need to camelCase things either way. Let's try this.
Comment #16
heddnThis is missing access modifiers of public on several functions. And I think if you change the name to validateMenuArgument, then it should be changed everywhere. For this mass conversion effort, why don't we leave it as validateArgument and we can come back later and decide on a better name.
Comment #17
drupee CreditAttribution: drupee commentedAgreed, Thanks for detailed explanation.
Comment #18
drupee CreditAttribution: drupee commented#15: 2002934-15.patch queued for re-testing.
Comment #19
damiankloip CreditAttribution: damiankloip commented@heddn, no I don't think so. I think you are getting things confused slightly - The patch in #15 is correct (hence the tests passed); not all the other instances need to be changed. This is not a case of renaming all validateArgument calls.
The current validate_argument() on *ArgumentPluginBase* is what I have changed to validateMenuArgument. There is already a validateArgument on this class. We also have validateArgument on argument validator plugins.
If we don't change this then we still get left with a validate_argument method, and that's not what we want.
Comment #21
damiankloip CreditAttribution: damiankloip commented#19: 2002934-19.patch queued for re-testing.
Comment #22
heddn@damiankloip, that makes more sense now. I went through Git and found where we used to have two functions with similar names.
validate_arg()
&
validate_argument
The first was renamed in #1763678: cleanup methods of PluginBase. This one is picking up the last of these two similarly named functions.
Shouldn't the implementations of ArgumentPluginBase also use the name validateMenuArgument? That's my guess why tests are failing.
Comment #23
damiankloip CreditAttribution: damiankloip commentedNo, The test was a random failure -
see the results on qa.drupal.org.EDIT: See #19 now....
On ArgumentPluginBase we already have validateArgument. The CURRENT validate_argument method is the only one used. That is the one being renamed.
Please stop moving the status to 'Needs work' when you are making assumptions and asking questions.
Comment #24
aspilicious CreditAttribution: aspilicious commentedComment #25
alexpottCommitted c06bf84 and pushed to 8.x. Thanks!