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.
Since [#1894902] functions like module_invoke, module_invoke_all, module_implements and drupal_alter are deprecated.
This clearly shows that we need injection for plugins and entities.
Comment | File | Size | Author |
---|---|---|---|
#63 | 1895266-63.patch | 27.54 KB | damiankloip |
#63 | interdiff.txt | 781 bytes | damiankloip |
#60 | drupal-1895266-60.patch | 27.61 KB | dawehner |
#60 | interdiff.txt | 1.53 KB | dawehner |
#59 | drupal-1895266-59.patch | 23.38 KB | dawehner |
Comments
Comment #1
dawehnerComment #3
dawehnerOh right so invokeAll takes an array of arguments.
Comment #5
dawehnerThere are still problems which are caused by non-running hooks.
Comment #7
dawehnerThat's just a rerole.
Comment #9
damiankloip CreditAttribution: damiankloip commentedThis should atleast help a bit. I'm thinking maybe we should get the module handler when the view instance is created? or in build or something, and store it?
Comment #10
damiankloip CreditAttribution: damiankloip commentedSorry, this patch. Interdiff is still good.
Comment #12
damiankloip CreditAttribution: damiankloip commentedOh, and that hook is not right.
Comment #13
damiankloip CreditAttribution: damiankloip commentedComment #15
damiankloip CreditAttribution: damiankloip commentedOk, now I just need to move the $module_handler var out of the if/else conditional.
Comment #16
damiankloip CreditAttribution: damiankloip commentedWe could convert the there stuff to use this too..
Comment #17
damiankloip CreditAttribution: damiankloip commentedMissed the post render theme hooks.
Comment #18
damiankloip CreditAttribution: damiankloip commentedSo maybe we shoudl also pass the module handler into the executable from the container as this is a service now.
Comment #19
damiankloip CreditAttribution: damiankloip commentedHere is a patch that does that too. So ViewExecutableFactory now passes the module handler to the ViewExecutable instance.
Comment #20
dawehnerGreat changes!!
Right so implementsHook works with themes as well, nice!
We should document the constructor now, maybe?
Comment #22
dawehnerWe can't do that at the moment :( The problem is that for example an exposed form has the form stored in the form cache, which requires then the object to be serializable, which is not the case for PDO, so not for moduleHandler.
Comment #23
damiankloip CreditAttribution: damiankloip commentedComment #24
damiankloip CreditAttribution: damiankloip commentedI think that is what we want now?
Comment #25
dawehnerOne empty line too much :) /** hides */
But yeah this is how we should do it.
Comment #26
damiankloip CreditAttribution: damiankloip commentedFine! There you go ;)
Comment #27
dawehnerThat is ready to roll now.
Comment #28
catchCan't ViewExecutable get this from the constructor?
Also I'm hoping #1875086: Improve DX of drupal_container()->get() can go in soon, this will need a re-roll once that's in.
Comment #29
dawehner@catch
Sadly we can't see #1895266-22: Convert views to use the ModuleHandler
It seems to be that we need to solve this general serialization problem in various parts once we inject everything in any part.
Comment #30
dawehnerSo back to needs review?
Comment #31
dawehnerOr even back to RTBC?
Comment #32
tim.plunkett#26: 1895266-26.patch queued for re-testing.
Comment #34
damiankloip CreditAttribution: damiankloip commentedrerolled.
Comment #35
dawehnerThanks for the rerole!
Back to RTBC
Comment #36
damiankloip CreditAttribution: damiankloip commentedNeeded another reroll after ViewsDataCache changes for DestructionInterface.
Comment #37
dawehnerReplaced everything with Drupal::service().
Comment #38
damiankloip CreditAttribution: damiankloip commentedAnnnd, back to RTBC again.
Comment #39
dawehner#37: drupal-1895266-37.patch queued for re-testing.
Comment #41
dawehner#37: drupal-1895266-37.patch queued for re-testing.
Comment #42
damiankloip CreditAttribution: damiankloip commentedComment #43
xjm#37: drupal-1895266-37.patch queued for re-testing.
Comment #44
alexpottNeeds a re-roll now that #1937600: Determine what services to register in the new Drupal class has landed
Comment #45
damiankloip CreditAttribution: damiankloip commentedRerolled to use Drupal::moduleHandler()
Comment #47
damiankloip CreditAttribution: damiankloip commentedRerolled, the ViewsDatCache patch got in..
Comment #49
damiankloip CreditAttribution: damiankloip commentedOops sorry, I stuffed up the merge slightly in ViewsDataCache!
Comment #50
dawehnerNice! That's green if it's green.
Comment #51
alexpottSeems the merge of ViewsDataCache is still slightly stuffed :)
Unused property...
Comment #52
damiankloip CreditAttribution: damiankloip commentedThe ViewsDataCache class was all messed up :) Let's try this.
Comment #53
alexpottI think that we also need to replace the following calls into module_* as well.
In \Drupal\views\Tests\ViewTestData...
In Drupal\views\Plugin\views\wizard twice... The module_handler service has a loadInclude() method which performs the same task. Hmmm... although this plugin is provided by views so views ui might not be enabled???
In views.module twice...
in Drupal\views\Tests\ViewsDataTest should use $this->container->get('module_handler')...
In Drupal\views\Tests\ViewsHooksTest should use $this->container->get('module_handler')...
In Drupal\views\tests\UI\TagTest should use $this->container->get('module_handler')...
In Drupal\views_ui\Form\Ajax\ViewsFormBase... this FormInterface probably should have the container injected and use it....
Comment #54
damiankloip CreditAttribution: damiankloip commentedSee #1914256: Add all views hooks to hook_hook_info()
Fixing the other things now.
Comment #55
damiankloip CreditAttribution: damiankloip commentedI have made the other change, I have only converted the usage in the ajax form base, as there is a todo to remove them anyway.
Comment #57
damiankloip CreditAttribution: damiankloip commentedOh dear, I think I see what's going on here, these are failing because of how moduleHandler works :( If the module isn't enabled, it can't include the file. So we need to enable views_ui for those 2 tests.
Comment #58
dawehnerThat's good again!
Comment #59
dawehnerAs written in IRC, removed the load include part.
Comment #60
dawehnerNow for real, relative to #57
Comment #61
dawehner#1962234: [Change notice] Move views_fetch_fields into an autoloadable class as a follow up
Comment #63
damiankloip CreditAttribution: damiankloip commentedReally bored of this issue now :)
Comment #64
damiankloip CreditAttribution: damiankloip commentedThis is back to RTBC, just reverting a change that shouldn't be there.
Comment #65
alexpottCommitted 12b09da and pushed to 8.x. Thanks!