File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
src/Magento/FunctionalTestingFramework/DataGenerator/Persist Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -201,13 +201,31 @@ private function resolveUrlReference($urlIn, $entityObjects)
201
201
202
202
if (!empty ($ matchedParams )) {
203
203
foreach ($ matchedParams [0 ] as $ paramKey => $ paramValue ) {
204
+
205
+ $ paramEntityParent = "" ;
206
+ $ matchedParent = [];
207
+ $ dataItem = $ matchedParams [1 ][$ paramKey ];
208
+ preg_match_all ("/(.+?)\./ " , $ dataItem , $ matchedParent );
209
+
210
+ if (!empty ($ matchedParent ) && !empty ($ matchedParent [0 ]))
211
+ {
212
+ $ paramEntityParent = $ matchedParent [1 ][0 ];
213
+ $ dataItem = preg_replace ('/^ ' .$ matchedParent [0 ][0 ].'/ ' , '' , $ dataItem );
214
+ }
215
+
204
216
foreach ($ entityObjects as $ entityObject ) {
205
- $ param = $ entityObject ->getDataByName (
206
- $ matchedParams [1 ][$ paramKey ],
207
- EntityDataObject::CEST_UNIQUE_VALUE
208
- );
217
+
218
+ if ($ paramEntityParent === "" || $ entityObject ->getType () == $ paramEntityParent )
219
+ {
220
+ $ param = $ entityObject ->getDataByName (
221
+ $ dataItem ,
222
+ EntityDataObject::CEST_UNIQUE_VALUE
223
+ );
224
+ }
225
+
209
226
if (null !== $ param ) {
210
227
$ urlOut = str_replace ($ paramValue , $ param , $ urlOut );
228
+ $ param = null ;
211
229
continue ;
212
230
}
213
231
}
You can’t perform that action at this time.
0 commit comments