Skip to content

Commit b09ec88

Browse files
fixup! feat: Calendar Import
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent ec12122 commit b09ec88

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apps/dav/lib/CalDAV/Import/ImportService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function importProcess(CalendarImpl $calendar, CalendarImportOptions $opt
221221
$calendarId = $calendar->getKey();
222222
$principalUri = $calendar->getPrincipalUri();
223223
$outcome = [];
224-
foreach ($generator($options) as $vObject) {
224+
foreach ($generator() as $vObject) {
225225
$components = $vObject->getBaseComponents();
226226
// determine if the object has no base component types
227227
if (count($components) === 0) {

apps/dav/lib/Command/ImportCalendar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ protected function configure(): void {
4646
->setDescription('Import calendar data to supported calendars from disk or stdin')
4747
->addArgument('uid', InputArgument::REQUIRED, 'Id of system user')
4848
->addArgument('uri', InputArgument::REQUIRED, 'Uri of calendar')
49+
->addArgument('location', InputArgument::OPTIONAL, 'Location of where to write the input. defaults to stdin')
4950
->addOption('format', null, InputOption::VALUE_REQUIRED, 'Format of input (ical, jcal, xcal) defaults to ical', 'ical')
50-
->addOption('location', null, InputOption::VALUE_REQUIRED, 'Location of where to write the input. defaults to stdin')
5151
->addOption('errors', null, InputOption::VALUE_REQUIRED, 'how to handel item errors (0 - continue, 1 - fail)')
5252
->addOption('validation', null, InputOption::VALUE_REQUIRED, 'how to handel item validation (0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue)')
5353
->addOption('supersede', null, InputOption::VALUE_NONE, 'override/replace existing items')
@@ -60,8 +60,8 @@ protected function configure(): void {
6060
protected function execute(InputInterface $input, OutputInterface $output): int {
6161
$userId = $input->getArgument('uid');
6262
$calendarId = $input->getArgument('uri');
63+
$location = $input->getArgument('location');
6364
$format = $input->getOption('format');
64-
$location = $input->getOption('location');
6565
$errors = is_numeric($input->getOption('errors')) ? (int)$input->getOption('errors') : null;
6666
$validation = is_numeric($input->getOption('validation')) ? (int)$input->getOption('validation') : null;
6767
$supersede = $input->getOption('supersede');

lib/public/Calendar/CalendarImportOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getFormat(): string {
5555
*/
5656
public function setFormat(string $value): void {
5757
if (!in_array($value, self::FORMATS, true)) {
58-
throw new InvalidArgumentException("Format is not valid.");
58+
throw new InvalidArgumentException('Format is not valid.');
5959
}
6060
$this->format = $value;
6161
}

0 commit comments

Comments
 (0)