mirror of
https://github.com/chenasraf/nextcloud-forum.git
synced 2026-05-17 17:28:02 +00:00
fix: show childless headers on admin category page
This commit is contained in:
15
Makefile
15
Makefile
@@ -309,6 +309,21 @@ test-docker:
|
||||
test-frontend:
|
||||
$(pnpm_cmd) vitest run
|
||||
|
||||
info_xsd_url=https://apps.nextcloud.com/schema/apps/info.xsd
|
||||
info_xsd=$(build_tools_directory)/info.xsd
|
||||
|
||||
$(info_xsd):
|
||||
@mkdir -p $(build_tools_directory)
|
||||
curl -sS -o $(info_xsd) $(info_xsd_url)
|
||||
|
||||
# lint-appinfo:
|
||||
# - Validate appinfo/info.xml against the Nextcloud App Store XSD schema
|
||||
.PHONY: lint-appinfo
|
||||
lint-appinfo: $(info_xsd)
|
||||
@echo "\x1b[33mValidating appinfo/info.xml against Nextcloud schema...\x1b[0m"
|
||||
@xmllint --noout --schema $(info_xsd) appinfo/info.xml
|
||||
@echo "\x1b[32mappinfo/info.xml is valid.\x1b[0m"
|
||||
|
||||
# lint:
|
||||
# - Lint JS via pnpm and PHP via composer script "lint"
|
||||
.PHONY: lint
|
||||
|
||||
@@ -20,3 +20,6 @@ pre-commit:
|
||||
openapi:
|
||||
glob: "*Controller.php"
|
||||
run: make openapi && git add openapi.json
|
||||
lint-appinfo:
|
||||
glob: "appinfo/info.xml"
|
||||
run: make lint-appinfo
|
||||
|
||||
@@ -106,13 +106,10 @@ class CategoryController extends OCSController {
|
||||
$categoriesByHeader[$headerId][] = $categoryData;
|
||||
}
|
||||
|
||||
// Build result with nested categories (only include headers that have accessible categories)
|
||||
// Build result with nested categories
|
||||
$result = [];
|
||||
foreach ($headers as $header) {
|
||||
$categories = $categoriesByHeader[$header->getId()] ?? [];
|
||||
if (empty($categories)) {
|
||||
continue;
|
||||
}
|
||||
$headerData = $header->jsonSerialize();
|
||||
$headerData['categories'] = $categories;
|
||||
$result[] = $headerData;
|
||||
|
||||
Reference in New Issue
Block a user