Skip to content

Commit ad1e17b

Browse files
committed
feat(search): send user to search result
1 parent 15934d4 commit ad1e17b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/Action/LoadPluginAction.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public function execute(string|PackageIndexEntry $packageInformation, \DateTimeI
6161
$mainExtensionYmlUrl = $githubUrl.'.shopware-extension.yml';
6262

6363
$pluginData = [
64-
'icon' => $githubUrl .'/'. ($version['extra']['plugin-icon'] ?? 'src/Resources/config/plugin.png'),
64+
'icon' => $this->checkIconUrl(
65+
$githubUrl .'/'. ($version['extra']['plugin-icon'] ?? 'src/Resources/config/plugin.png')
66+
),
6567
...$packageInformation->additionalMetadataExists ? $this->fetchExtensionYmlData($mainExtensionYmlUrl, $githubUrl) : [],
6668
'packageName' => $packageInformation->packageName,
6769
'manufacturer' => implode(', ', array_column($version['authors'], 'name')),
@@ -149,6 +151,13 @@ private function fetchExtensionYmlData(string $mainExtensionYmlUrl, string $gith
149151
return $pluginData;
150152
}
151153

154+
private function checkIconUrl(string $iconUrl): ?string
155+
{
156+
$response = $this->httpClient->request('GET', $iconUrl);
157+
158+
return 200 === $response->getStatusCode() && strlen($response->getContent()) > 10 ? $iconUrl : null;
159+
}
160+
152161
private function findSuitableVersion(array $packagistData): ?array
153162
{
154163
$versions = $packagistData['package']['versions'];

src/Controller/MediaProxyController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function execute(Request $request): Response
5151
return $this->malformedRequestError();
5252
}
5353

54-
$response = $this->cache->get($url, function (ItemInterface $item) use ($url): array {
54+
$response = $this->cache->get(md5($url), function (ItemInterface $item) use ($url): array {
5555
$response = $this->client->request('GET', $url);
5656
$statusCode = $response->getStatusCode();
5757

src/Resources/app/administration/src/extension/sw-search-bar-item/sw-search-bar-item.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block nuonic_plugin_installer_search_bar_item_opensource_plugin %}
55
<router-link
66
v-else-if="type === 'nuonic_available_opensource_plugin'"
7-
:to="{ name: 'nuonic.plugin.installer.list', params: { id: item.id } }"
7+
:to="{ name: 'nuonic.plugin.installer.list', query: { term: item.packageName } }"
88
ref="routerLink"
99
class="sw-search-bar-item__link">
1010
{% block nuonic_plugin_installer_search_bar_item_opensource_plugin_label %}

0 commit comments

Comments
 (0)