From 7dba4b9284318a0e4b098881df581e76c41bdfcc Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 12 Oct 2021 15:44:48 -0600 Subject: [PATCH] Placeholders - avoid infinite recursion if apps have custom fields of other apps --- api/src/Storage/Merge.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index 9e4e5e00a2..d08ab3b624 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -3079,6 +3079,12 @@ abstract class Merge */ protected function add_customfield_placeholders(&$placeholders, $prefix = '') { + // Avoid recursing between custom fields of different apps + if(substr_count($prefix, '#') > 1) + { + return; + } + foreach(Customfields::get($this->get_app()) as $name => $field) { if(array_key_exists($field['type'], Api\Link::app_list())) @@ -3108,7 +3114,6 @@ abstract class Merge public function get_placeholder_list($prefix = '') { $placeholders = [ - 'placeholders' => [] ]; $this->add_customfield_placeholders($placeholders, $prefix); @@ -3212,7 +3217,6 @@ abstract class Merge */ public function show_replacements() { - $template_name = 'api.show_replacements'; $content = $sel_options = $readonlys = $preserve = array();