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 $view->storage->display contains of ViewDisplay objects even this object is for storage only.
In general as the storage is not handled by viewDisplay anymore you could get rid of these objects,
let $storage->display only contains the pure config options
and use an array of display handlers on the viewExecutable.
Comment | File | Size | Author |
---|---|---|---|
#27 | views-1788238-27.patch | 204.19 KB | dawehner |
#25 | views-1788238-25.patch | 203.67 KB | dawehner |
#23 | views-1788238-23.patch | 199.81 KB | dawehner |
#22 | views-1788238-22.patch | 199.79 KB | dawehner |
#20 | views-1788238-20.patch | 199.29 KB | dawehner |
Comments
Comment #1
dawehnerI will work on that.
Comment #2
tim.plunkettI started a sandbox branch for this: http://drupalcode.org/sandbox/damiankloip/1685040.git/shortlog/refs/head...
One thing that can be done is making sure the code actually NEEDS the whole display object.
An example is http://drupalcode.org/sandbox/damiankloip/1685040.git/commitdiff/e8d9504
Comment #3
tim.plunkettlol
Comment #4
dawehnerAdded tests and refactored one function:
a5f411b get the paths without instanciating the displays
33dd513 add tests for getDisplayList, getPath and addDisplay
The main issue with doing that at the moment is that for example the wizard is using
the active handlers to save values and the handler itself has logic we need in methods like
getItems (for example override).
We should probably store a reference to $storage->display['id'] which is an array of the options
directly in the display handler.
Comment #5
tim.plunkettThe difference between ViewExecutable::display and ViewStorage::display is maddening.
We need different property names for each.
And this is blocking the removal of __set/__get code.
Comment #6
dawehnerSome ideas:
My favourite is option two at the moment, maybe you have another preference?
Comment #7
tim.plunkettdisplayHandlers is good. Also, are we worried about $this->display AND $this->displays in this issue?
Comment #8
dawehnerAt the moment views most often uses singular for multiple instance of objects (like the database tables), for example view->filter, view->field
so i think if we do it, we should do it later but for all of them.
Comment #9
dawehner50c918a write tests for ViewStorage::add/set/getItem(s) and fix one issue in ViewStorage
145e6e7 first introduction of displayHandlers and some tests for the methods
Let's first introduce $executable->displayHandlers and then remove the ViewDisplay objects.
At the moment i just wrote test and converted the tested methods to the new array.
Comment #10
dawehner9a13d78 let the plugins just store the display handler instance instead of the viewDisplay and adapt all the function calls
697a258 convert a lot of usages of display handlers to the new array
Comment #12
dawehnerSo let's retest it.
Comment #14
dawehnerOne less php fatal
Comment #16
dawehnerLet's see whether this is better
Comment #18
dawehnerI totally think that could be made better, what about storing a reference to the display options in the display plugins?
From the runned local tests this could be green aka. good to go on an work on ViewDisplay.
Comment #20
dawehnerStarted to remove the viewDisplay object and replace every place which uses it, this change
is currently not committed but i would like the bot to run on that.
Comment #22
dawehnerSome more fixes, tsss still not 200kb
Comment #23
dawehnerEven more fixes.
Comment #25
dawehnerThis could be it, yes 200kb!
Comment #27
dawehnerAt least the amount of fails/exceptions and passes were sort of symmetric.
Comment #28
tim.plunkettI REALLY want to commit this now, but I should do a full review tonight.
Hopefully it'll be in before you wake up @dawehner :)
Comment #29
dawehnerThis doesn't sound good!
This could be $this->view->display_handler instead.
For the rest i'm to tired now
Comment #30
tim.plunkettHm, I can't come up with a better comment right now, but let's find one.
I think the $this->view->current_display stuff could be a follow-up.
This is reallllly great stuff.
Comment #31
dawehnerNot bad: 75 files changed, 836 insertions(+), 772 deletions(-)
This patch is one reason to use git commit -a :)