File tree 4 files changed +24
-9
lines changed
lib/internal/Magento/Framework/View
4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -207,13 +207,15 @@ protected function scheduleReference(
207
207
$ elementRemove = filter_var ($ currentElement ->getAttribute ('remove ' ), FILTER_VALIDATE_BOOLEAN );
208
208
if ($ elementRemove ) {
209
209
$ scheduledStructure ->setElementToRemoveList ($ elementName );
210
- } else {
211
- $ data = $ scheduledStructure ->getStructureElementData ($ elementName , []);
212
- $ data ['attributes ' ] = $ this ->mergeBlockAttributes ($ data , $ currentElement );
213
- $ this ->updateScheduledData ($ currentElement , $ data );
214
- $ this ->evaluateArguments ($ currentElement , $ data );
215
- $ scheduledStructure ->setStructureElementData ($ elementName , $ data );
210
+ return ;
211
+ } elseif ($ currentElement ->getAttribute ('remove ' )) {
212
+ $ scheduledStructure ->unsetElementFromListToRemove ($ elementName );
216
213
}
214
+ $ data = $ scheduledStructure ->getStructureElementData ($ elementName , []);
215
+ $ data ['attributes ' ] = $ this ->mergeBlockAttributes ($ data , $ currentElement );
216
+ $ this ->updateScheduledData ($ currentElement , $ data );
217
+ $ this ->evaluateArguments ($ currentElement , $ data );
218
+ $ scheduledStructure ->setStructureElementData ($ elementName , $ data );
217
219
}
218
220
219
221
/**
Original file line number Diff line number Diff line change @@ -141,11 +141,12 @@ protected function containerReference(
141
141
) {
142
142
$ containerName = $ currentElement ->getAttribute ('name ' );
143
143
$ containerRemove = filter_var ($ currentElement ->getAttribute ('remove ' ), FILTER_VALIDATE_BOOLEAN );
144
-
145
144
if ($ containerRemove ) {
146
145
$ scheduledStructure ->setElementToRemoveList ($ containerName );
147
- } else {
148
- $ this ->mergeContainerAttributes ($ scheduledStructure , $ currentElement );
146
+ return ;
147
+ } elseif ($ currentElement ->getAttribute ('remove ' )) {
148
+ $ scheduledStructure ->unsetElementFromListToRemove ($ containerName );
149
149
}
150
+ $ this ->mergeContainerAttributes ($ scheduledStructure , $ currentElement );
150
151
}
151
152
}
Original file line number Diff line number Diff line change @@ -188,6 +188,12 @@ public function testProcessReference(
188
188
$ setCondition ,
189
189
$ setRemoveCondition
190
190
) {
191
+ if ($ literal == 'referenceBlock ' && $ remove == 'false ' ) {
192
+ $ this ->scheduledStructure ->expects ($ this ->once ())
193
+ ->method ('unsetElementFromListToRemove ' )
194
+ ->with ($ literal );
195
+ }
196
+
191
197
$ this ->context ->expects ($ this ->once ())->method ('getScheduledStructure ' )
192
198
->will ($ this ->returnValue ($ this ->scheduledStructure ));
193
199
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ public function testProcess(
102
102
->with ($ contextMock , $ elementCurrent )
103
103
->willReturnSelf ();
104
104
105
+ if ($ elementCurrent ->getAttribute ('remove ' ) == 'false ' ) {
106
+ $ scheduledStructureMock ->expects ($ this ->once ())
107
+ ->method ('unsetElementFromListToRemove ' )
108
+ ->with ($ elementCurrent ->getAttribute ('name ' ));
109
+ }
110
+
105
111
$ this ->container ->interpret ($ contextMock , $ elementCurrent );
106
112
}
107
113
You can’t perform that action at this time.
0 commit comments