Fixes: Simplify PageController, fix config API, update deployment package (2026-02-17)

- Removed service dependencies from PageController constructor
- Fixed AdminController config API signatures
- Cleaned up Application.php resource loading
- Updated template with proper resource includes
- Simplified routes.php
- Reduced analyticshub.zip from 50KB to 27KB
- Status: Fixed and ready for redeployment
This commit is contained in:
WLTBAgent
2026-02-22 06:56:57 +00:00
parent 69dfdc5f87
commit 49b6b37277
8 changed files with 94 additions and 59 deletions

View File

@@ -1,7 +1,7 @@
# Nextcloud Google Analytics Hub - Current Status
**Status**: **PAUSED** - Waiting for deployment testing
**Last Update**: 2026-02-13 14:17 GMT
**Status**: 🔧 **FIXED** - Ready for redeployment
**Last Update**: 2026-02-17 14:23 GMT
---
@@ -218,6 +218,53 @@ return [
---
## Latest Fixes (2026-02-17)
### Issue: App not accessible after configuration
User reported:
- No entry appears in menu bar
- Redirect to dashboard when accessing `/apps/analyticshub`
### Root Causes Identified:
1. **PageController constructor failure**: Required GoogleAnalyticsService and LLMService injection, which weren't properly registered in DI container
2. **Incorrect config API usage**: AdminController was using `getAppValue('key', 'app', '')` instead of correct signature `getAppValue('app', 'key', '')`
3. **Template rendering**: Used 'admin' rendering mode instead of 'blank'
### Fixes Applied:
1.**Simplified PageController**:
- Removed service dependencies from constructor
- Uses only IConfig (core Nextcloud service)
- Graceful configuration checking without service dependencies
- Uses 'blank' rendering mode for clean admin interface
2.**Fixed AdminController config API**:
- Corrected all `getAppValue` calls: `getAppValue('analyticshub', 'key', '')`
- Corrected all `setAppValue` calls: `setAppValue('analyticshub', 'key', value)`
3.**Cleaned up Application.php**:
- Removed automatic script/style loading (caused issues)
- Resources now loaded in template only when needed
4.**Updated template**:
- Added proper script/style includes
- Removed manual CSRF token (handled by JavaScript with OC.requestToken)
5.**Simplified routes.php**:
- Removed redundant requirements fields
- Cleaner route definitions
### Files Modified:
- `lib/Controller/PageController.php` - Removed service dependencies, fixed rendering mode
- `lib/Controller/AdminController.php` - Fixed config API signatures
- `appinfo/Application.php` - Removed automatic resource loading
- `templates/admin.php` - Added proper resource includes, removed manual CSRF
- `appinfo/routes.php` - Cleaned up route definitions
### New Package:
- `analyticshub.zip` (27KB) - Ready for redeployment
---
## What Needs to Happen
**Before Further Development:**