We want to reduce the amount of procedural code, so let's move views_fetch_fields() for example into the views_ui module.
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | 39-42-interdiff.txt | 698 bytes | alexpott |
| #42 | vdc-1962234-42.patch | 29.43 KB | alexpott |
| #39 | vdc-1962234-39.patch | 29.37 KB | dawehner |
| #39 | interdiff.txt | 1.58 KB | dawehner |
| #33 | vdc-1962234-33.patch | 28.85 KB | dawehner |
Comments
Comment #1
dawehnerNot sure whether this is the right location.
Comment #3
dawehnerI think putting it into the ViewsDataCache makes sense.
Comment #5
dawehnerLet's see.
Comment #7
dawehnerDoh!
Comment #8
tim.plunkettLooks good overall.
Why is this added? Looks like PHPStorm might have gotten ahead of itself? :)
Extra blank lines.
Should be static, not self. Or I think you can do array($this, 'fetchedFieldSort'), not sure if that's better or worse?
Comment #9
dawehnerYeah this happens if you a) are lazy and use phpstorm and b) you are lazy and don't review the patch before uploading.
Comment #10
damiankloip commentedI rerolled anyway, but have a couple of points.
Should we use the Views class here? or just get it form the container? I'm not sure.
Fetches (I know it's just moving it, but might as well!)
Can't we just store this as a property on the class and do away with this static?
Comment #11
dawehnerCreated a views_data_helper service.
To be honest, I would like to have a total different naming, but i'm not sure about a better naming. Any suggestions?
Comment #12
Bojhan commentedLooks like this is blocking #1832858: Revamp descriptions of items in handler listings
Comment #13
dawehner#11: drupal-1962234-11.patch queued for re-testing.
Comment #15
dawehnerI still don't really like the different names, but at least rerole the patch.
Comment #16
dawehner#15: drupal-1962234-15.patch queued for re-testing.
Comment #17
damiankloip commentedI think this class should be called ViewsDataHelper. If we are going the route of having separate classes. Then I would like to change the ViewsDataCache class to ViewsData as I think that is a better fit.
Otherwise, I think the patch looks good!
EDIT: #1989806: Rename ViewsDataCache to ViewsData is related.
Comment #18
damiankloip commentedSo we could make this ViewsDatHelper then both service names will be consistent with their class, win :) (IMO)
Comment #20
damiankloip commentedSorry, getting ahead of myself.
Comment #21
dawehnerTwo minor bits.
ups
I don't think we use that here.
This should link to ViewsDataHelper
Should be ViewsDataCache
Comment #22
damiankloip commentedHere is a reroll, with comments above.
Comment #23
dawehnerAwesome!
Comment #24
alexpottHow about using
Unicode::strtolower():)Comment #25
damiankloip commentedHow about that :)
Comment #26
dawehnerJust wondering whether we actually should use String::format instead as it's kind of an exception, which also don't have an translation.
Comment #27
damiankloip commentedI guess if we don't need this to be t() then we might as well.
Comment #28
damiankloip commentedComment #29
dawehnerThank you very much.
Comment #30
alexpottHmmm... the $this->fields property is never set or used so in effect you've removed the static caching...
Comment #31
dawehnerWow I realized that these specific tests are currently totally break, due to $expected_keys = array_walk(), which returns TRUE/FALSE, all the time.
Here are the converted tests to phpunit with an mock object that ensures that the result is cached.
Comment #33
dawehnerComment #34
damiankloip commented#33: vdc-1962234-33.patch queued for re-testing.
Comment #36
damiankloip commented#33: vdc-1962234-33.patch queued for re-testing.
Comment #37
damiankloip commentedPatch is good, tests look great.
Comment #38
alexpottWe still have two references to views_fetch_fields in comments...
Comment #39
dawehnerOh you are right. Thank you for that catch.
Comment #40
tim.plunkettConfirmed that views_fetch_fields is well and truly gone now.
Comment #42
alexpottWe've got some new status handlers... due to #1998192: Allow the boolean labels of exposed filters to be configurable
Comment #43
damiankloip commentedYes, I added those :) looks good.
Comment #44
alexpottCommitted b15e921 and pushed to 8.x. Thanks!
Comment #46
xjmComment #47
chris matthews commentedFor more information as to why this issue was moved to the Drupal core project, please see issue #3030347: Plan to clean process issue queue
Comment #48
chris matthews commentedMoving back to the contributed Views issue queue and closing as outdated per https://www.drupal.org/project/views/issues/3030347#comment-13023447