Follow up for #1446382-27: Need a reliable way to determine if a specific bundle for an entity type is translatable through #33
Problem/Motivation
+++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.phpundefined
@@ -985,6 +985,13 @@ public function getOriginalEntity() {
+ return $this->__call(__FUNCTION__, func_get_args());
looks like confusing, possibly infinite looping magic.
But it's a common pattern, in many existing methods in that class.
It pass the call through to __call() which forwards any method call to $this->storage.
Proposed resolution
Instead of just documenting though, change it to call $this->storage directly instead of doing that indirection which just slows things down.
The same way that EntityBCDecorator does it, which means simply $this->storage->isTranslatable() in this case or $this->storage->setNewRevision($value) for an example with arguments. The additional human-overhead of doing this once is not big but it helps both with performance and it's better to understand.
Remaining tasks
- make this issue summary accurate
User interface changes
No UI changes.
API changes
No API changes.
Original report by @xjm, @Berdir, @tim.plunkett
in #1446382-27: Need a reliable way to determine if a specific bundle for an entity type is translatable through #33
Comment | File | Size | Author |
---|---|---|---|
#10 | 1945348-10.patch | 10.25 KB | damiankloip |
#8 | 1945348-8.patch | 10.45 KB | damiankloip |
#7 | 1945348-7.patch | 0 bytes | damiankloip |
#3 | 1945348.patch | 10.46 KB | damiankloip |
Comments
Comment #1
xjmComment #2
xjmComment #3
damiankloip CreditAttribution: damiankloip commentedComment #4
BerdirIf we also want to support calls to the storage that is not defined in the interface, then we could keep it, just not use it for the explicitly defined methods. I don't know if there are any such calls, I guess the testbot will tell us?
Comment #5
damiankloip CreditAttribution: damiankloip commentedYeah, testbot can tell us. Sure thought, if you want I can just add that back in. Or do you want to wait to see if we actually need it? Maybe it does make sense to have it anyway, not sure.
Comment #7
damiankloip CreditAttribution: damiankloip commentedepic fail there.
Comment #8
damiankloip CreditAttribution: damiankloip commentedBah..
Comment #10
damiankloip CreditAttribution: damiankloip commentedok, maybe __call needs to stay.
Comment #12
tim.plunkett#10: 1945348-10.patch queued for re-testing.
Comment #13
dawehnerNice!
Comment #14
xjmIs this title accurate? I am parroting @dawehner. :D
Comment #15
webchickGosh, that's much nicer!
Committed and pushed to 8.x. Thanks!
Comment #16
olli CreditAttribution: olli commented#1962130: Fatal Error: ViewUI::isTranslatable endless loop