Fix template field type (#7294)

* Virtual Profile Field Type: Template

* Autocommit PHP CS Fixer

* Virtual Profile Field Type: Template

* Virtual Profile Field Type: Template

* Virtual Profile Field Type: Template

* Virtual Profile Field Type: Template

* Virtual Profile Field Type: Template

* Fix Virtual Profile Field Type: Template

---------

Co-authored-by: gevorgmansuryan <gevorgmansuryan@users.noreply.github.com>
This commit is contained in:
Gevorg Mansuryan 2024-11-06 01:03:27 +04:00 committed by GitHub
parent fef4e7f6c4
commit 91ee2ab748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ HumHub Changelog
- Enh #7287: Add `Template` virtual field
- Enh #7291: Disable link in `TopicLabel` when contentContainer is not present
- Enh #7293: Add Twig string extension
- Fix #7287: Fix `Profile::getFormDefinition` to skip virtual fields
1.17.0-beta.1 (October 28, 2024)
--------------------------------

View File

@ -229,6 +229,10 @@ class Profile extends ActiveRecord
/** @var ProfileField $profileField */
$profileField->editable = true;
if ($profileField->fieldType->isVirtual) {
continue;
}
if (!in_array($profileField->internal_name, $safeAttributes)) {
if ($profileField->visible && $this->scenario != 'registration') {
$profileField->editable = false;