Edited on Jan 05, 2026 By Gavin .
Ok I guess updating the discussion isn't working:
Here is the list of issues
- Some of the paths only accepts root directory, which doesn't support subfolders. Example:
http://localhost/Flatboardwill not work since it only allowshttp://localhost - Documentation for plugins needs work because it's way to vauge to understand especally when I never delt with your updated plugins.
- Error logging also needs work because it give ZERO details on why a plugin isn't loading.
In summary: The front end looks good, but the backend and documentation just need a lot more work, because it confusing where the errors are coming from and the documentation is just very unclear on what you're suppose to do.
Edited on Dec 21, 2025 By Gavin .
Thank you for your feedback! Here's what will be fixed in the next version:
The UrlHelper::full() method now detects if site_url already contains the subfolder and avoids duplication.
What was fixed:
If site_url = http://localhost/Flatboard and baseUrl = /Flatboard, the method detects that the subfolder is already present in site_url and does not add baseUrl again.
Result: http://localhost/Flatboard/discussion instead of http://localhost/Flatboard/Flatboard/discussion.
How it works:
- The path of
site_urlis extracted usingparse_url(). - It's then compared with
baseUrl. - If the subfolder is already present, only
pathis appended tosite_url. - Otherwise, the usual construction is used with
baseUrl + path.
This allows site_url to be used with the full subfolder (e.g., http://localhost/Flatboard) without duplication.
Ok here is what I'm getting
- Console error
Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:599:34)
- The create discussion button still relocatates to
/discussions/createmake sure its
Location:app/Views/discussions/index.php line:23
<?php
// Construire l'URL selon le contexte
$createUrl = './discussions/create';
if ($selectedCategorySlug) {
$createUrl .= '?category=' . urlencode($selectedCategorySlug);
}
Console error when creating a post
POST http://localhost/d/3-test/posts 404 (Not Found) toast.js:361
Edited on Dec 22, 2025 By Gavin .
I Was Able to Reproduce This Bug and I Will Update the Archives Within the Hour Updated!
Fixed Links in Main Views
- app/Views/discussions/index.php: used
UrlHelper::to()for the discussion creation and login links. - app/Views/discussions/show.php: used
UrlHelper::to()for the new discussion link. - All themes (premium, bootswatch, mybb-classic): same corrections applied.
Improved Detection
- The
detectBaseUrl()function inUrlHelperuses multiple methods to detect the subfolder.
Installation
base_urlis automatically detected and saved during installation.
How to Test
Check that
base_urlcontains/FLATBOARD5instorage/json/config.json.If it doesn’t, you can:
- Manually edit the
config.jsonfile and set"base_url": "/FLATBOARD5". - Or call
\App\Helpers\UrlHelper::resetBaseUrl()once to force detection.
- Manually edit the
Clear the PHP cache (restart PHP-FPM or the web server).
Test the links:
- The "Start a new topic" button → should redirect to
/FLATBOARD5/discussions/create. - The "Forum" and "Admin" links → should include the subfolder.
- The "Start a new topic" button → should redirect to
Expected Outcome
The URLs should now work correctly with the subfolder. If the issue persists, check that base_url is correctly set in config.json.
Edited on Dec 23, 2025 By Fred .
/d/3-test/posts:1 Failed to load resource: the server responded with a status of 404 (Not Found)
3-test:3088 Error: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
(anonymous) @ 3-test:3088
main.js:626 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:626:34)
main.js:599 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:599:34)
(anonymous) @ main.js:599
main.js:626 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:626:34)
(anonymous) @ main.js:626
main.js:599 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:599:34)
(anonymous) @ main.js:599
main.js:626 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:626:34)
(anonymous) @ main.js:626
toast.js:361 POST http://localhost/d/3-test/posts 404 (Not Found)
(anonymous) @ toast.js:361
(anonymous) @ 3-test:3049
3-test:3088 Error: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
(anonymous) @ 3-test:3088
Promise.catch
(anonymous) @ 3-test:3087
main.js:599 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:599:34)
(anonymous) @ main.js:599
main.js:626 Uncaught TypeError: e.target.closest is not a function
at HTMLDocument.<anonymous> (main.js:626:34)
(anonymous) @ main.js:626
Some fetch locations are wrong here is the full console error.
- File upload will only return the base
/uploadswhich again no supporting subfolders - Updating discussions doesn't work
- Creating post is also not possible (that is in error log)
Edited on Dec 24, 2025 By Gavin .
URL Helper Fixes for Subdirectory Support
1. Fix for url-helper.js
- Updated to use
window.BASE_URLif available - Takes subdirectory into account in URLs
2. Fix for Hardcoded URLs in show.php
- Replaced all
/d/${numberSlug}/...URLs withwindow.url(\/d/${numberSlug}/...`)` - Replaced all
/api/...URLs withwindow.url(\/api/...`)` - Fixed files:
app/Views/discussions/show.phpthemes/premium/views/discussions/show.phpthemes/bootswatch/views/discussions/show.php
3. Fix for Upload URLs
- Using
UrlHelper::to()for image, avatar, and attachment upload URLs - Returned URLs now include the subdirectory
Result
- POST requests to
/d/{number_slug}/postswork with subdirectory - Image uploads return URLs with subdirectory
- Discussion actions (subscribe, pin, lock, etc.) work with subdirectory
- API requests work with subdirectory
All URLs now use window.url() or UrlHelper::to(), which automatically take the subdirectory into account. The 404 errors and incorrect URL issues should be resolved.
This discussion is locked