@@ -200,7 +200,7 @@ public function getApiVersion(): ?string
200200 throw new LogicException ('The contest source is not valid ' );
201201 }
202202
203- return $ this ->cachedApiInfoData ->version ;
203+ return $ this ->cachedApiInfoData ? ->version;
204204 }
205205
206206 public function getApiVersionUrl (): ?string
@@ -209,7 +209,7 @@ public function getApiVersionUrl(): ?string
209209 throw new LogicException ('The contest source is not valid ' );
210210 }
211211
212- return $ this ->cachedApiInfoData ->versionUrl ;
212+ return $ this ->cachedApiInfoData ? ->versionUrl;
213213 }
214214
215215 public function getApiProviderName (): ?string
@@ -218,7 +218,7 @@ public function getApiProviderName(): ?string
218218 throw new LogicException ('The contest source is not valid ' );
219219 }
220220
221- return $ this ->cachedApiInfoData ->provider ?->name ?? $ this ->cachedApiInfoData ->name ;
221+ return $ this ->cachedApiInfoData ? ->provider?->name ?? $ this ->cachedApiInfoData ? ->name;
222222 }
223223
224224 public function getApiProviderVersion (): ?string
@@ -227,7 +227,7 @@ public function getApiProviderVersion(): ?string
227227 throw new LogicException ('The contest source is not valid ' );
228228 }
229229
230- return $ this ->cachedApiInfoData ->provider ?->version ?? $ this ->cachedApiInfoData ->domjudge ?->version;
230+ return $ this ->cachedApiInfoData ? ->provider?->version ?? $ this ->cachedApiInfoData ? ->domjudge?->version;
231231 }
232232
233233 public function getApiProviderBuildDate (): ?string
@@ -236,7 +236,7 @@ public function getApiProviderBuildDate(): ?string
236236 throw new LogicException ('The contest source is not valid ' );
237237 }
238238
239- return $ this ->cachedApiInfoData ->provider ?->buildDate;
239+ return $ this ->cachedApiInfoData ? ->provider?->buildDate;
240240 }
241241
242242 public function getLoadingError (): string
@@ -1435,6 +1435,14 @@ protected function importSubmission(Event $event, EventData $data): void
14351435 $ zipUrl = ($ this ->basePath ?? '' ) . $ zipUrl ;
14361436 }
14371437
1438+ if ($ this ->source ->getType () === ExternalContestSource::TYPE_CONTEST_PACKAGE && $ data ->files [0 ]->filename ) {
1439+ $ zipUrl = $ this ->source ->getSource () . '/submissions/ ' . $ data ->id . '/ ' . $ data ->files [0 ]->filename ;
1440+ if (!file_exists ($ zipUrl )) {
1441+ // Common case: submissions are in submissions/<id>.zip
1442+ $ zipUrl = $ this ->source ->getSource () . '/submissions/ ' . $ data ->id . '.zip ' ;
1443+ }
1444+ }
1445+
14381446 $ tmpdir = $ this ->dj ->getDomjudgeTmpDir ();
14391447
14401448 // Check if we have a local file.
0 commit comments