diff --git a/modules/DynamicFields/DynamicField.php b/modules/DynamicFields/DynamicField.php index e52cea01db3..8e44b81adb5 100755 --- a/modules/DynamicFields/DynamicField.php +++ b/modules/DynamicFields/DynamicField.php @@ -806,6 +806,12 @@ public function sticSaveExtendedAttributes($field, $fmd) $to_save['default'] = htmlspecialchars_decode($field->ext4, ENT_QUOTES); } // END STIC-Custom + // STIC-Custom ART 20241203 - Height defined in iframe field not respected + // https://github.com/SinergiaTIC/SinergiaCRM/pull/502 + if($field->type == 'iframe' && ($field->ext4 != $fmd->ext4) || !isset($fmd->ext4)) { + $to_save['height'] = (isset($field->ext4) && is_numeric($field->ext4)) ? $field->ext4 : '200'; + } + // END STIC-Custom } $bean_name = $beanList[$this->module]; diff --git a/modules/DynamicFields/templates/Fields/TemplateIFrame.php b/modules/DynamicFields/templates/Fields/TemplateIFrame.php index dff8cbd0c05..f0f79954af8 100755 --- a/modules/DynamicFields/templates/Fields/TemplateIFrame.php +++ b/modules/DynamicFields/templates/Fields/TemplateIFrame.php @@ -60,14 +60,30 @@ public function get_html_label() public function get_xtpl_detail() { $value = parent::get_xtpl_detail(); - $value .= "BLAH BLAH"; - return $value; - } + // STIC-Custom ART 20241203 - Height defined in iframe field not respected + // https://github.com/SinergiaTIC/SinergiaCRM/pull/502 + // $value .= "BLAH BLAH"; + // return $value; + + // Gets the height value from the updated vardef or the default value + $height = !empty($this->link_target) ? $this->link_target : $this->height; + // Returns an array with the required data + return [ + 'value' => $value, + 'height' => $height, + ]; + // END STIC-Custom + } + public function get_field_def() { $def = parent::get_field_def(); - $def['height'] = !empty($this->height) ? $this->height : $this->ext4; + // STIC-Custom ART 20241203 - Height defined in iframe field not respected + // https://github.com/SinergiaTIC/SinergiaCRM/pull/502 + // $def['height'] = !empty($this->height) ? $this->height : $this->ext4; + $def['height'] = !empty($this->link_target) ? $this->link_target : $this->ext4; + // END STIC-Custom return $def; } } diff --git a/modules/ModuleBuilder/parsers/StandardField.php b/modules/ModuleBuilder/parsers/StandardField.php index 892c23bfdb3..417ddc1a619 100755 --- a/modules/ModuleBuilder/parsers/StandardField.php +++ b/modules/ModuleBuilder/parsers/StandardField.php @@ -165,6 +165,14 @@ public function addFieldObject(&$field) } } } + + // STIC-Custom ART 20241203 - Height defined in iframe field not respected + // https://github.com/SinergiaTIC/SinergiaCRM/pull/502 + // Updates the height in the standard fields + if($field->type == 'iframe' && ($field->ext4 != $this->custom_def["link_target"]) || !isset($this->custom_def["link_target"])) { + $this->custom_def["height"] = (isset($field->ext4) && is_numeric($field->ext4)) ? $field->ext4 : $this->custom_def["link_target"]; + } + // END STIC-Custom } if (isset($this->custom_def["duplicate_merge_dom_value"]) && !isset($this->custom_def["duplicate_merge"])) {