Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.5.0] - 2026-03-09

* [PR-76](https://github.com/itk-dev/itk_pretix/pull/76)
Added contact_mail property

## [1.4.0] - 2026-02-02

* [PR-74](https://github.com/itk-dev/itk_pretix/pull/74)
Expand Down Expand Up @@ -63,7 +68,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Initial release

[Unreleased]: https://github.com/itk-dev/itk_pretix/compare/1.4.0...HEAD
[Unreleased]: https://github.com/itk-dev/itk_pretix/compare/1.5.0...HEAD
[1.5.0]: https://github.com/itk-dev/itk_pretix/compare/1.4.0...1.5.0
[1.4.0]: https://github.com/itk-dev/itk_pretix/compare/1.3.0...1.4.0
[1.3.0]: https://github.com/itk-dev/itk_pretix/compare/1.2.3...1.3.0
[1.2.3]: https://github.com/itk-dev/itk_pretix/compare/1.2.2...1.2.3
Expand Down
15 changes: 15 additions & 0 deletions itk_pretix.install
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ function itk_pretix_update_10101(&$sandbox) {
);
}

/**
* Add contact_mail property.
*/
function itk_pretix_update_10102(&$sandbox) {
_itk_pretix_field_type_add_properties(
'pretix_event_settings',
[
'contact_mail' => [
'type' => 'varchar',
'length' => 256,
],
]
);
}

/**
* Lifted from https://drupal.stackexchange.com/a/295485.
*/
Expand Down
8 changes: 8 additions & 0 deletions src/Plugin/Field/FieldType/PretixEventSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* )
*
* @property string template_event
* @property string contact_mail
* @property bool synchronize_event
*/
class PretixEventSettings extends FieldItemBase {
Expand All @@ -32,6 +33,9 @@ public static function propertyDefinitions(
$properties['template_event'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Template event'))
->setRequired(TRUE);
$properties['contact_mail'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Template event'))
->setRequired(TRUE);
$properties['synchronize_event'] = DataDefinition::create('boolean')
->setLabel(new TranslatableMarkup('Synchronize event'))
->setRequired(TRUE);
Expand All @@ -52,6 +56,10 @@ public static function schema(
'type' => 'varchar',
'length' => 128,
],
'contact_mail' => [
'type' => 'varchar',
'length' => 256,
],
'synchronize_event' => [
'type' => 'int',
'size' => 'tiny',
Expand Down
7 changes: 7 additions & 0 deletions src/Plugin/Field/FieldWidget/PretixEventSettingsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ public function formElement(
'#required' => $element['#required'] && !empty($templateEventOptions),
];

$element['contact_mail'] = [
'#type' => 'textfield',
'#title' => $this->t('Contact mail'),
'#default_value' => $items[$delta]->contact_mail,
'#required' => $element['#required'],
];

$element['synchronize_event'] = [
'#type' => 'checkbox',
'#title' => $this->t('Synchronize event in pretix'),
Expand Down
2 changes: 1 addition & 1 deletion src/Pretix/EventHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function syncronizePretixEvent(NodeInterface $node, array $options) {
$eventData['event'] = $event->toArray();

// Event settings.
$contactMail = $node->get('field_email_address')->getValue()[0]['value'] ?? NULL;
$contactMail = $settings->contact_mail;
if (empty($contactMail)) {
// In pretix the contact mail cannot be empty, but it can be null.
$contactMail = NULL;
Expand Down