Skip to content

Commit

Permalink
Merge pull request #4307 from nextcloud/ci/oci-selfhosted
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Dec 12, 2024
2 parents bbb63d9 + 098a2a9 commit cd761f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ jobs:
run: cd tests && bash run-integration.sh features/${{ matrix.scenarios }}.feature

oci:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

needs: changes
if: needs.changes.outputs.src != 'false'
Expand Down
11 changes: 7 additions & 4 deletions composer/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ private static function getInstalled()
}

$installed = array();
$copiedLocalDir = false;

if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
Expand All @@ -330,9 +331,11 @@ private static function getInstalled()
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $required;
$copiedLocalDir = true;
}
}
}
Expand All @@ -350,7 +353,7 @@ private static function getInstalled()
}
}

if (self::$installed !== array()) {
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}

Expand Down
4 changes: 2 additions & 2 deletions composer/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '88eb9d7b4bbe5f42df84e9ed12183e91554e0a1d',
'reference' => 'a020a8fa3bc95f7b2107173c1e1caa634a7c6671',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '88eb9d7b4bbe5f42df84e9ed12183e91554e0a1d',
'reference' => 'a020a8fa3bc95f7b2107173c1e1caa634a7c6671',
'type' => 'library',
'install_path' => __DIR__ . '/../',
'aliases' => array(),
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/DirectViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ public function show($token) {
$template = $direct->getTemplateId() ? $this->templateManager->getTemplateSource($direct->getTemplateId()) : null;

if ($template !== null) {
$wopi = $this->tokenManager->generateWopiTokenForTemplate($template, $direct->getUid(), $item->getId(), true);
$wopi = $this->tokenManager->generateWopiTokenForTemplate($template, $item->getId(), $direct->getUid(), false, true);
}

if ($wopi === null) {
$urlSrc = $this->tokenManager->getUrlSrc($item);
$wopi = $this->tokenManager->generateWopiToken($item->getId(), null, $direct->getUid(), true);
$wopi = $this->tokenManager->generateWopiToken((string)$item->getId(), null, $direct->getUid(), true);
}
} catch (\Exception $e) {
$this->logger->error('Failed to generate token for existing file on direct editing', ['exception' => $e]);
Expand Down

0 comments on commit cd761f1

Please sign in to comment.