FUEL-CMS-Blog-Module icon indicating copy to clipboard operation
FUEL-CMS-Blog-Module copied to clipboard

404 on blog posts

Open Crispy1975 opened this issue 8 years ago • 27 comments

With a plain blog install and after following the instructions (downloaded zip etc.), I am now getting a 404 on trying to view a post, or the main /blog/ URL. Is there a config setting for the routes that I am missing somewhere or is something wrong here? The admin for the blog seems to work as expected...

Crispy1975 avatar May 21 '16 15:05 Crispy1975

It sounds like something is wrong. What version of FUEL are you running (master or develop branch) and have there been any modifications made or is it a fresh copy?

daylightstudio avatar May 21 '16 16:05 daylightstudio

I thought I would test drive it today, downloaded the zip for master of both FuelCMS and the blog module.

Crispy1975 avatar May 21 '16 16:05 Crispy1975

The develop branch has CI 3.0 and is more compatible with PHP 7.0 as an FYI.

daylightstudio avatar May 21 '16 16:05 daylightstudio

We're running PHP 5.4 along with Apache 2.2 (FastCGI). I got Fuel running just fine and made a mini-news module based on the docs tutorials. All that worked, just the blog module is causing issues.

Crispy1975 avatar May 21 '16 16:05 Crispy1975

The casing issues with the blog are setup to work with the develop branch at the moment and may be part of the problem you are experiencing. So references to require Base_module_model.php may need to be lower cased.

daylightstudio avatar May 21 '16 16:05 daylightstudio

Yeah, I lower cased these and the blog module now works fine in the Fuel admin panel, I can add posts and all that just fine. Now just the 404 to fix. I will pull dev branch later and try against that.

Crispy1975 avatar May 21 '16 16:05 Crispy1975

I had a same problem with this. When I install on my localhost, nothing's problem. Then, when I install to www.mysite.com, the www.mysite.com/blog was not found (404). Could anyone tell me what is wrong?

rizkyfirmansyah avatar Jun 17 '16 11:06 rizkyfirmansyah

Do you have the latest version of the Blog module?

daylightstudio avatar Jun 17 '16 15:06 daylightstudio

I don't know which version is the latest. I'm using module version of 1.1

rizkyfirmansyah avatar Jun 21 '16 04:06 rizkyfirmansyah

Have you pulled from the master branch recently?

daylightstudio avatar Jun 21 '16 04:06 daylightstudio

Yes I did pulled recently. There is no issue when I installed in localhost, but when in www.mysite.com/blog an error was encountered: Unable to locate the file: blog_posts_model.php Then, I lowercased all in blog/models and it works. But, in www.mysite.com/blog is still 404. Please help...

rizkyfirmansyah avatar Jun 21 '16 04:06 rizkyfirmansyah

OK... I think the issue may have had to do with the conditional comparing between Fuel versions. I've posted a fix to the master branch: https://github.com/daylightstudio/FUEL-CMS-Blog-Module/commit/5dc254526a121383fa64857390be9ef04ff8ce4b

daylightstudio avatar Jun 21 '16 05:06 daylightstudio

I have replaced the model with your updated branch 5dc2545. But i'm still facing the same problem: Unable to locate the file: blog_posts_model.php

rizkyfirmansyah avatar Jun 21 '16 05:06 rizkyfirmansyah

Hi,

I've update the source code to the latest version and still receive the 404 page not found error. It works fine on local machine but gives error on the server

squeegels avatar Jun 21 '16 19:06 squeegels

What version of FUEL are you running (fuel/modules/fuel/config/fuel_constants.php has the FUEL_VERSION constant in it)?

daylightstudio avatar Jun 21 '16 20:06 daylightstudio

I'm running FUEL on the 1.3.2 version. Yes, It tells define('FUEL_VERSION', '1.3.2');

rizkyfirmansyah avatar Jun 21 '16 21:06 rizkyfirmansyah

I see the issue I think. You may need to lower case your model names in the fuel/modules/blog/models folder. GIT will not recognize these changes so you'll need to do the following if for your repos to recognize the change. http://stackoverflow.com/questions/17683458/how-do-i-commit-case-sensitive-only-filename-changes-in-git

Or, I've pushed a fix to the master branch to try out. The develop branch is on CI 3 and all model, library and controllers are capitalized.

daylightstudio avatar Jun 21 '16 22:06 daylightstudio

I have replaced all my code to your master branch and lower cased my fuel/modules/blog/models folder, still it did not solve yet. I've also tried your develop branch but nothing's different.

When I tried to use different version of Fuel (1.4), i was facing another problem: Message: Unable to locate the model you have specified: Guests_model

Oh God, i really stuck here.

rizkyfirmansyah avatar Jun 22 '16 05:06 rizkyfirmansyah

This sounds like its a casing issue with the file names of the models. In CI 3 all library, model and controller class file names need to first be capitalized. In 1.3.2, that is not the case. The blog module however did have the model names capitalized for the upcoming 1.4 release which can cause problems in server environments that are case sensitive.

daylightstudio avatar Jun 22 '16 05:06 daylightstudio

Yup definitely a casing issue. I had to make my controller files and model files lower case for it to work.

I thought the last update was supposed to fix this?

squeegels avatar Jun 22 '16 08:06 squeegels

Thanks squeegels and daylight. It solved when I make the controller files being lower case.

rizkyfirmansyah avatar Jun 22 '16 09:06 rizkyfirmansyah

@daylightstudio you can tell git to not ignore case, if memory serves it should be...

git config --global core.ignorecase false

Remove the --global for the current repo.

Crispy1975 avatar Jun 22 '16 09:06 Crispy1975

@Crispy1975 ... good to know. Thanks.

daylightstudio avatar Jun 22 '16 15:06 daylightstudio

I'm facing the same problem. I've tried the solutions listed above, nothing worked for me. Anyone managed to solve the issue?

valeria-melinte avatar Aug 08 '16 07:08 valeria-melinte

@valeria-melinte What version of FUEL are you running? You may try changing the controller file names to be lower case.

daylightstudio avatar Aug 08 '16 15:08 daylightstudio

it's working fine when the controllers name are changed in lower case. that is the solution, thanks a lot!

kristdev avatar Sep 06 '16 18:09 kristdev

I can confirm that renaming the files in fuel/modules/blog/controllers/ to be all lower-case resolves the issue.

rikkouri avatar Sep 06 '16 19:09 rikkouri