Closed roojai closed 6 months ago
@roojai I cannot reproduce the issue right away. Would it be possible for you to provide me the offlineboxes* tables from your database? You can e-mail them to me.
Thank you for providing me with a db dump. Switching sites works on my end. Can you confirm that you have no component on the page that triggers the 404 redirect (like an {% abort(404) %}
in Twig or a return $this->controller->run(404);
in a php component?
Also, how do you differentiate your sites? Are you using an URL prefix or a different hostname per site? It is possible that Boxes does not catch that for some reason.
If you want to debug the issue on your end, the problem is problably here: https://github.com/OFFLINE-GmbH/oc-boxes-free-plugin/blob/584ef04107d6da8c913928a037d25f75ff731366/Plugin.php#L100
getPreviewPage
method call probably returns null
which results in a 404.Hi Tobias,
OK, I did some debugging.
This always returns my main site, it does not return the active site.
When I load a page, it seems to call this function twice:
So I forced the site to the correct site:
Now I get the correct site in the log, but still have the same issue, it does not resolve the problem,
On Tue, 16 Apr 2024 at 21:03, Tobias Kündig @.***> wrote:
Thank you for providing me with a db dump. Switching sites works on my end. Can you confirm that you have no component on the page that triggers the 404 redirect (like an {% abort(404) %} in Twig or a return $this->controller->run(404); in a php component?
Also, how do you differentiate your sites? Are you using an URL prefix or a different hostname per site? It is possible that Boxes does not catch that for some reason.
If you want to debug the issue on your end, the problem is problably here:
- it might not resolve the right site
- the prefix is handled wrong
- the getPreviewPage method call probably returns null which results in a 404.
— Reply to this email directly, view it on GitHub https://github.com/OFFLINE-GmbH/oc-boxes-support/issues/119#issuecomment-2059039975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHN2MTJAJGDDSPI7Z7EMHATY5UORBAVCNFSM6AAAAABGHI6CMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJZGAZTSOJXGU . You are receiving this because you were mentioned.Message ID: @.***>
Thank you @roojai! I was able to find the culprit: Boxes stores the Theme with every page and only fetches pages from the active theme.
Since October does not change the Site context in the backend (and therefore sets the new active theme), we have to work around this.
Please give v3.6.8 a try and let me know if the issue is solved.
Thanks @tobias-kuendig
I tried v 3.6.8 and its a lot better (can see the preview content now).
However its not quite as before the issue arose.
My site has different CSS and different partials between site versions, but when on another site the previewer is showing CSS from main site, and some partials seem to be the wrong version. I need to investigate further if these are using the same file names or not. The multisite sis work fine before whatever changed.
the previewer is showing CSS from main site
I'll take another look at it. It seems like the theme is not switched to the Site's theme override properly.
The multisite sis work fine before whatever changed.
This is probably because the displayed 404 page was being shown with the proper theme.
@roojai, please give v3.6.9 a go.
Thanks for trying! If I have partials with the same name in different multi-sites, the previewer loads the version from the mainsite, and not the active site
In addition, I have some data in the theme settings for each site, which I access like this for example:
$theme = Theme::getActiveTheme(); $themeData = ThemeData::forTheme($theme); $themecolors = $themeData->getAttribute('themecolours');
the boxes preview uses the data from the main site, and not the active site.
@roojai, please give v3.6.10 another try.
That's fixed it, great work! Thanks @tobias-kuendig
Great to hear, thank you for your patience!
Describe the bug I have made no changes to my site other than updating the OctoberCMS version and also the Boxes version and now I cannot access content within the pages editor for multisites. If I select the main site, all is fine and I can access content in the boxes plugin editor, but as soon as I change site to another of the multi-sites, then I get a 404 in the boxes editor. On the frontend, all is fine, the multi-sites work ok.
I simply can no longer edit them.
Is this something to do with the "Page on the main site" functionality - as before we did not have this?
FYI, I use the multi-site to show completely different content, with different URLs, I do dot use it for language variations
Boxes Version v3.6.1