File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ class ConfigFieldPlugin
3939 */
4040 private $ request ;
4141
42+ /**
43+ * @var array<string>
44+ */
45+ private $ handledFields = [];
46+
4247 public function __construct (
4348 Escaper $ escaper ,
4449 ScopeConfigInterface $ scopeConfig ,
@@ -98,7 +103,15 @@ public function afterGetData(
98103 return $ result ;
99104 }
100105
101- $ result ['path_hint ' ] = '<small> ' . __ ('Path: <code>%1</code> ' , $ this ->getPath ($ subject ) . '</small> ' );
106+ // make sure we only calculate the path hint once
107+ // there is a known issue with a plugin from the MultiSafepay module (FieldPlugin) that can cause an infinite loop
108+ // this solves it by calculating the field's object hash and making sure we only call getPath once per Field
109+ $ fieldObjectHash = spl_object_hash ($ subject );
110+ if (!in_array ($ fieldObjectHash , $ this ->handledFields , true )) {
111+ $ this ->handledFields [] = $ fieldObjectHash ;
112+
113+ $ result ['path_hint ' ] = '<small> ' . __ ('Path: <code>%1</code> ' , $ this ->getPath ($ subject ) . '</small> ' );
114+ }
102115
103116 return $ result ;
104117 }
You can’t perform that action at this time.
0 commit comments