{% set current = old is defined and old ? old : {} %} {% set fieldName = current.name is defined ? current.name : (item ? item.title : '') %} {% set fieldDescription = current.description is defined ? current.description : (item and item.excerpt ? item.excerpt : '') %} {% set fieldDocumentType = current.documentType is defined ? current.documentType : (item and item.documentType ? item.documentType : '') %} {% set fieldLegalFramework = current.legalFramework is defined ? current.legalFramework : (item and item.legalFramework ? item.legalFramework : '') %} {% set fieldStatus = current.status is defined ? current.status : (item ? item.status : 'DRAFT') %} {% set fieldAccess = current.accessLevel is defined ? current.accessLevel : (item and item.accessLevel ? item.accessLevel : 'all_users') %} {% set fieldVersion = current.version is defined ? current.version : (item and item.version ? item.version : '1.0') %} {% set fieldLastLegalUpdate = current.lastLegalUpdateAt is defined ? current.lastLegalUpdateAt : (item and item.lastLegalUpdateAt ? item.lastLegalUpdateAt|date('Y-m-d') : '') %} {% set fieldCompliance = current.complianceNote is defined ? current.complianceNote : (item and item.complianceNote ? item.complianceNote : '') %} {% set fieldKeywords = current.keywords is defined ? current.keywords : (item and item.keywords ? item.keywords|join(', ') : '') %} {% set fieldTags = current.tags is defined ? current.tags : (item and item.tags ? item.tags|join(', ') : '') %} {% set fieldContent = current.contentHtml is defined ? current.contentHtml : (item and item.contentHtml ? item.contentHtml : '') %} {% set selectedSectors = current.sectors is defined ? current.sectors : (item and item.sectors ? item.sectors : []) %} {% set isRecommended = current.isRecommended is defined ? current.isRecommended : (item and item.isRecommended ? '1' : '') %} {% set requiresLegalValidation = current.requiresLegalValidation is defined ? current.requiresLegalValidation : (item and item.requiresLegalValidation ? '1' : '') %} {% if errors is defined and errors|length > 0 %}