File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,19 @@ public function bootAddon()
1414 Field::computedDefault ('default-events-timezone ' , fn () => Statamic::displayTimezone ());
1515 Field::computedDefault ('default-event-timezone ' , fn () => Events::defaultTimezone ());
1616
17- collect (Events::setting ('collections ' , ['events ' ]))
18- ->each (function (string $ collection ) {
19- Collection::findByHandle ($ collection )?->entryBlueprint()->ensureField (
20- 'timezone ' ,
21- [
22- 'dictionary ' => 'timezones ' ,
23- 'max_items ' => '1 ' ,
24- 'type ' => 'dictionary ' ,
25- 'default ' => 'computed:default-event-timezone ' ,
26- ]);
27- });
17+ // has to be in booted so that the `events::event` fieldset is properly registered and loaded
18+ $ this ->booted (function () {
19+ collect (Events::setting ('collections ' , ['events ' ]))
20+ ->each (function (string $ collection ) {
21+ Collection::findByHandle ($ collection )?->entryBlueprint()->ensureField (
22+ 'timezone ' ,
23+ [
24+ 'dictionary ' => 'timezones ' ,
25+ 'max_items ' => '1 ' ,
26+ 'type ' => 'dictionary ' ,
27+ 'default ' => 'computed:default-event-timezone ' ,
28+ ]);
29+ });
30+ });
2831 }
2932}
You can’t perform that action at this time.
0 commit comments