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.
At the moment views_ui_cache_set() just deals with the ViewsUI object, so it seems to be perfectly logical, to have that as a method on the object.
Comment | File | Size | Author |
---|---|---|---|
#36 | 1919700-36.patch | 21.36 KB | damiankloip |
#36 | interdiff-1919700-36.txt | 3.63 KB | damiankloip |
#33 | 1919700-33.patch | 19.07 KB | damiankloip |
#30 | 1919700-30.patch | 19.33 KB | damiankloip |
#29 | 1919700-29.patch | 19.36 KB | damiankloip |
Comments
Comment #1
damiankloip CreditAttribution: damiankloip commentedHow about this? I have also changed the tests slightly in CachedDataUITest, to also test the cancel button on the edit form works correctly.
Looking at the ViewUIConverter, as it already uses the tempstore, could we pass this into the ViewUI so we won't need to make a drupal_container() call in cacheSet. thoughts? We could also, have a better name for this method. Also, thoughts? :)
Comment #2
tim.plunkettThis conflicts pretty heavily with #1919142: Convert Views UI AJAX forms to use FormInterface, and I keep getting confused since I see code I've removed in that issue :)
I'll take a real look at this over the weekend.
Comment #3
damiankloip CreditAttribution: damiankloip commentedOK, let's postpone this one on that. This is a pretty small patch anyway, so it can just be re rolled when that issue is in. Probably easier for all involved :)
Comment #4
damiankloip CreditAttribution: damiankloip commentedLet's get this moving again, rerolled.
Comment #5
damiankloip CreditAttribution: damiankloip commentedShould probably use Drupal::service() too.
Comment #6
dawehnerGreat effort!
Locked is still documented as boolean, though it is actually a TempStore object. If it's a tempstore object, shouldn't this piece of code actually fail because ->owner is a protected property? Additional we could simply check of if ($this->locked instanceof TempStore)
Just wondering whether we could inject this into the class? I guess no, because it's used in form state.
Comment #7
tim.plunkett$this->locked isn't a TempStore object, it's the result of TempStore::getMetadata(), which is either a stdClass or NULL.
Comment #8
dawehnerOH, I see, but yeah bool still feels wrong.
Comment #9
damiankloip CreditAttribution: damiankloip commentedYeah, I guess we would have seen a few notices if we couldn't access that. I'll change the doc for the locked property.
Comment #10
damiankloip CreditAttribution: damiankloip commented#5: 1919700-5.patch queued for re-testing.
Comment #11
damiankloip CreditAttribution: damiankloip commentedChanged the $locked property doc on ViewExecutable.
Comment #12
dawehnerShould we maybe look at the content of the locked object as well?
Thank you!
Comment #13
damiankloip CreditAttribution: damiankloip commentedI think these tests are ok how they are, as NULL will be returned if no entry is found for the current user. I'm not sure we need to test the tempstore owner etc.. and the user tempstore tests will be covering that already?
Comment #14
damiankloip CreditAttribution: damiankloip commentedWe can remove that call to views_get_view in the test though I think.
Comment #15
damiankloip CreditAttribution: damiankloip commentedOK, Let's help dawehner sleep at night and change the tests :) Check the owner is equal to the lock owner, and that it is equal to NULL when it should be.
Comment #16
dawehnerThank you!
Then we should document this new user variable?
Comment #17
damiankloip CreditAttribution: damiankloip commentedGood point, here we go.
Comment #19
damiankloip CreditAttribution: damiankloip commented#17: 1919700-17.patch queued for re-testing.
Comment #20
dawehnerPerfect
Comment #21
webchickThis all looks like fine clean-up, but that cacheSet() method name is confusing. I was originally going to ask "Why can't Views just do a normal cache()->set() like everyone else?" only to find out that the method has nothing at all to do with setting caches and has everything to do instead with interacting with the user tempstore.
I realize this is a "pre-existing condition" since the function name you're moving away from is called views_ui_cache_set(), but it'd be nice to clean that up as well, since we are in "clean-up" phase after all. :)
Comment #22
tim.plunkettHere it is with setTempStore() instead.
Comment #23
xjm+1, this is much nicer.
This doesn't need to be two sentences (nor should it, grammatically speaking).
Also, good tests!
Comment #24
damiankloip CreditAttribution: damiankloip commentedOk, we can make that a comma instead.
Comment #25
dawehnerBack to RTBC. I also like the improvement here.
Comment #26
damiankloip CreditAttribution: damiankloip commentedJust spotted a typo in one of the asserts. Tiny change.
Comment #27
xjm#26: 1919700-26.patch queued for re-testing.
Comment #28
alexpottSeem to have a duplicate assertion of the view not being locked.
Comment #29
damiankloip CreditAttribution: damiankloip commentedGood point, that last assertion is pointless there.
Comment #30
damiankloip CreditAttribution: damiankloip commentedRerolled, after unsaved view message text got changed.
Comment #31
dawehnerBack to RTBC
Comment #32
alexpottViews UI has moved...
Comment #33
damiankloip CreditAttribution: damiankloip commentedIndeed it has...
Comment #34
dawehnerLet's wait until it's green.
Comment #35
damiankloip CreditAttribution: damiankloip commented#33: 1919700-33.patch queued for re-testing.
Comment #36
damiankloip CreditAttribution: damiankloip commentedMe and Alex talked about this earlier and decided it would be nice to have an isLocked() method that encapsulates this logic, and change the property to lock instead of locked.
Comment #37
tim.plunkettNice improvement!
Comment #38
alexpottCommitted 34acf68 and pushed to 8.x. Thanks!
Comment #40
xjmComment #41
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design 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 #42
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedMoving back to the contributed Views issue queue and closing as outdated per https://www.drupal.org/project/views/issues/3030347#comment-13023447