I've performed a deep dive into the vendor/fof/gamification/src directory. It appears that the beta.3 version is missing core components for the rankings system.
grep -r "rankings" returns nothing in the src folder.
The Api/Controllers folder is missing the list/top controllers.
There is no Api/Serializers directory at all.
It seems this build is just a skeleton for Flarum 2.0 compatibility, but the actual gamification logic hasn't been ported yet.
I have performed a thorough investigation into my environment (Flarum 2.0.0-rc.1) to understand why the /api/fof/gamification/top route is returning a 404. Here is a summary of my findings which might help in fixing the build:
- Source Code Discrepancy:
After checking the vendor/fof/gamification/src directory, it appears that several core components required for the rankings system are physically missing from the beta.3 build:
Missing Controllers: A check of src/Api/Controllers shows only ConvertLikesController.php, DeleteTopImageController.php, and UploadTopImageController.php. The expected ListTopUsersController.php (or equivalent) is missing.
Missing Serializers: The entire src/Api/Serializers directory is absent.
Missing References: Running grep -r "rankings" inside the src folder returns no results, suggesting the logic for the rankings page hasn't been ported or included in this release.
- The extend.php State:
Immediately after the update to beta.3, the extend.php file in the extension root was essentially empty:
PHP
<?php
use Flarum\Extend;
return [
];
(Self-Correction): I previously attempted to inject a custom listener for PostWasVoted into this file to fix vote synchronization, but even after reverting to the "clean" state provided by the package, the 404 error persists because the routes are not being registered by the extension's core.
- Database Integrity:
I have verified that the votes and rank_id columns in the users table are still present and contain the correct data. The issue is strictly at the API/Routing layer, preventing the frontend from fetching this data.
Conclusion:
It seems the current beta.3 build on Packagist might be a "skeleton" version where the API routes and ranking logic were accidentally omitted during the transition to Flarum 2.0.
I hope this helps the team pinpoint the issue! Let me know if you need any further logs from my server.