File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ class ConfigFieldPlugin
3939 */
4040 private $ request ;
4141
42- /**
43- * @var array<string>
44- */
45- private $ handledFields = [] ;
42+ /**
43+ * @var bool
44+ */
45+ private $ isProcessing = false ;
4646
4747 public function __construct (
4848 Escaper $ escaper ,
@@ -103,15 +103,14 @@ public function afterGetData(
103103 return $ result ;
104104 }
105105
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 ;
106+ // to avoid a potential infinite loop, we keep a flag to see if we are already handling this particular field
107+ if (!$ this ->isProcessing ) {
108+ $ this ->isProcessing = true ;
112109
113- $ result ['path_hint ' ] = '<small> ' . __ ('Path: <code>%1</code> ' , $ this ->getPath ($ subject ) . '</small> ' );
114- }
110+ $ result ['path_hint ' ] = '<small> ' . __ ('Path: <code>%1</code> ' , $ this ->getPath ($ subject ) . '</small> ' );
111+
112+ $ this ->isProcessing = false ;
113+ }
115114
116115 return $ result ;
117116 }
You can’t perform that action at this time.
0 commit comments