This commit is contained in:
Shish
2024-01-05 15:32:07 +00:00
parent 4b954b2e68
commit 26630a4e3b
4 changed files with 7 additions and 6 deletions

View File

@@ -224,7 +224,9 @@ if(class_exists("\\PHPUnit\\Framework\\TestCase")) {
"tags" => Tag::explode($tags), "tags" => Tag::explode($tags),
"source" => null, "source" => null,
])); ]));
if(count($dae->images) == 0) throw new \Exception("Upload failed :("); if(count($dae->images) == 0) {
throw new \Exception("Upload failed :(");
}
return $dae->images[0]->id; return $dae->images[0]->id;
} }

View File

@@ -10,7 +10,7 @@ class BulkAddTheme extends Themelet
{ {
/** /**
* Show a standard page for results to be put into * Show a standard page for results to be put into
* *
* @param UploadResult[] $results * @param UploadResult[] $results
*/ */
public function display_upload_results(Page $page, array $results) public function display_upload_results(Page $page, array $results)

View File

@@ -170,7 +170,7 @@ class GraphQL extends Extension
'source' => $source, 'source' => $source,
])); ]));
return ["image_ids" => array_map(fn($im) => $im->id, $event->images)]; return ["image_ids" => array_map(fn ($im) => $im->id, $event->images)];
} }
public function onCommand(CommandEvent $event) public function onCommand(CommandEvent $event)

View File

@@ -120,12 +120,11 @@ class S3 extends Extension
if(is_null($new_tags)) { if(is_null($new_tags)) {
$friendly = $image->parse_link_template('$id - $tags.$ext'); $friendly = $image->parse_link_template('$id - $tags.$ext');
} } else {
else {
$_orig_tags = $image->get_tag_array(); $_orig_tags = $image->get_tag_array();
$image->tag_array = $new_tags; $image->tag_array = $new_tags;
$friendly = $image->parse_link_template('$id - $tags.$ext'); $friendly = $image->parse_link_template('$id - $tags.$ext');
$image->tag_array = $_orig_tags; $image->tag_array = $_orig_tags;
} }
$client->putObject([ $client->putObject([