v17development / flarum-blog

The Flarum Blog extension
https://discuss.flarum.org/d/25392-blog-adds-a-blog-section-to-your-community
MIT License
46 stars 20 forks source link

Error while trying to visit the blog with a clean browser #159

Closed therealmaxmoon closed 1 year ago

therealmaxmoon commented 1 year ago

I was testing Flarum on FreeFlarum, but had issues running the Blog extension.

The blog isn't accessible from outside. Every time I use a link to a blog post (in a fresh browser), it only shows the following error:

An error occurred while trying to load this page.

Is this a known issue of the extension or is it possible that it's a problem of FreeFlarum?

Versions

Flarum: 1.8.1 PHP: 8.2.4 MySQL: 10.11.2-MariaDB-1:10.11.2+maria~ubu2204-log Blog extension: v0.7.2

davwheat commented 1 year ago

Try enabling v17 SEO.

therealmaxmoon commented 1 year ago

Try enabling v17 SEO.

After activating the extension SEO, the blog worked.

Is there an explanation why it only works with SEO optimization?

It shouldn't be possible to activate the Blog extension, if SEO is deactivated. I am pretty new to Flarum, but at least I've seen other extensions, which have dependencies and show an error, which extension must be active to activate the current extension.

This would prevent a lot of issues, saves time for the users, would be a clean thing and it would fit to the v17 slogan:

"Our power is to improve your experience."

Thanks a lot for your help :)

davwheat commented 1 year ago

The technical reasons are in #150

Essentially, the PHP code will see SEO if SEO is installed but not enabled (like on FreeFlarum). This means that Blog will attempt to use SEO features which then won't work because SEO isn't actually enabled as an extension.

therealmaxmoon commented 1 year ago

Please don't close this issue, because it is still an issue.

If the blog extension only checks if SEO is installed, but not if it's active, it's a huge problem. Why can't it be fixed, so it will work like other extensions, which have dependencies to other extensions and give proper error messages so that the user knows what to do? And extensions can't be activated until the dependencies are active.

If solving the dependency issue is too much, please consider to add a warning in the first lines on the admin page of blog with a small warning that SEO MUST be active otherwise the blog will not work.

davwheat commented 1 year ago

I closed it because it's a duplicate of an existing issue I mentioned above. Having two issues detailing the same issue is useless from a developer perspective.

therealmaxmoon commented 1 year ago

Ah, I see.

Thank you :)