Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix - Administración - Altura de IFrame no se recogía al cambiarla #502

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
6 changes: 6 additions & 0 deletions modules/DynamicFields/DynamicField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
24 changes: 20 additions & 4 deletions modules/DynamicFields/templates/Fields/TemplateIFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
8 changes: 8 additions & 0 deletions modules/ModuleBuilder/parsers/StandardField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"])) {
Expand Down
Loading