File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public function execute(): ResultInterface|ResponseInterface
5858
5959 foreach ($ updates as $ update ) {
6060 try {
61- $ debugMessage = 'Component update: ' .$ update ->getBlock ()->getNameInLayout ();
61+ $ debugMessage = 'Component update: ' .$ update ->getComponent ()->getName ();
6262 $ this ->logger ->debug ($ debugMessage );
6363
6464 $ this ->repositoryDispatcher ->dispatch (
@@ -102,14 +102,12 @@ public function execute(): ResultInterface|ResponseInterface
102102 *
103103 * @return ComponentUpdate[]
104104 */
105- private function getComponentUpdates (array $ updates, LayoutInterface $ layout ): array
105+ private function getComponentUpdates (array $ updates ): array
106106 {
107107 $ componentUpdates = [];
108108 foreach ($ updates as $ updateIndex => $ update ) {
109- $ block = $ this ->getBlock ($ layout , $ update ['blockName ' ]);
110109 $ componentUpdate = $ this ->componentUpdateFactory ->create ([
111- 'block ' => $ block ,
112- 'component ' => $ this ->componentRegistry ->getComponentFromBlock ($ block ),
110+ 'component ' => $ this ->componentRegistry ->getComponentByName ($ update ['blockName ' ]),
113111 'componentData ' => $ update ['update ' ],
114112 ]);
115113
Original file line number Diff line number Diff line change 33namespace Loki \Components \Util \Controller ;
44
55use Loki \Components \Component \Component ;
6- use Magento \Framework \View \Element \AbstractBlock ;
76
87class ComponentUpdate
98{
109 public function __construct (
11- private readonly AbstractBlock $ block ,
1210 private readonly Component $ component ,
1311 private readonly mixed $ componentData = null
1412 ) {
1513 }
1614
17- public function getBlock (): AbstractBlock
18- {
19- return $ this ->block ;
20- }
21-
2215 public function getComponent (): Component
2316 {
2417 return $ this ->component ;
You can’t perform that action at this time.
0 commit comments