I’m having an issue when browsing the App Store pages on my instance where it renders all the categories but then any category that I pick shows no apps. I’m running v13.0.0.3 (alpha) for testing and have verified the apps.json and categories.json files are populated correctly on the data directory.
Debugging through the code I notice that when the route (AppSettings#listApps
) invokes : AppSettingsController
's public function listApps($category = '')
, the category parameter is empty even though I see it being passed in the URL: http://localhost:8080/index.php/settings/apps?category=auth
Any idea why the router would be discarding the parameter or that wouldn’t be making to the controller?
I figured out what my problem was. In my config I had the htaccess.RewriteBase
config key set to /
so I wouldn’t see the index.php
on the URLs, alongside the other relevant configs, and apparently the rewrite rule it generates doesn’t include the QSA
flag, so I had to change that in Setup.php
:
$rewriteBase = $config->getValue('htaccess.RewriteBase', '');
if($rewriteBase !== '') {
$content .= "\n<IfModule mod_rewrite.c>";
$content .= "\n Options -MultiViews";
$content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !\\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !core/img/manifest.json$";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/remote.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/public.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/cron.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/status.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/robots.txt";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/updater/";
$content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/";
$content .= "\n RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*";
$content .= "\n RewriteRule . index.php [QSA,PT,E=PATH_INFO:$1]";
$content .= "\n RewriteBase " . $rewriteBase;
$content .= "\n <IfModule mod_env.c>";
$content .= "\n SetEnv front_controller_active true";
$content .= "\n <IfModule mod_dir.c>";
$content .= "\n DirectorySlash off";
$content .= "\n </IfModule>";
$content .= "\n </IfModule>";
$content .= "\n</IfModule>";
}
Maybe open an issue in the repo here and if accepted create a pull request to fix it? https://github.com/nextcloud/server/