daylightstudio / FUEL-CMS-Blog-Module

A blog module for FUEL CMS
18 stars 18 forks source link

404 on blog posts #23

Open Crispy1975 opened 8 years ago

Crispy1975 commented 8 years ago

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...

daylightstudio commented 8 years ago

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?

Crispy1975 commented 8 years ago

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

daylightstudio commented 8 years ago

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

Crispy1975 commented 8 years ago

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.

daylightstudio commented 8 years ago

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.

Crispy1975 commented 8 years ago

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.

rizkyfirmansyah commented 8 years ago

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?

daylightstudio commented 8 years ago

Do you have the latest version of the Blog module?

rizkyfirmansyah commented 8 years ago

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

daylightstudio commented 8 years ago

Have you pulled from the master branch recently?

rizkyfirmansyah commented 8 years ago

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...

daylightstudio commented 8 years ago

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

rizkyfirmansyah commented 8 years ago

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

squeegels commented 8 years ago

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

daylightstudio commented 8 years ago

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

rizkyfirmansyah commented 8 years ago

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

daylightstudio commented 8 years ago

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.

rizkyfirmansyah commented 8 years ago

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.

daylightstudio commented 8 years ago

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.

squeegels commented 8 years ago

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?

rizkyfirmansyah commented 8 years ago

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

Crispy1975 commented 8 years ago

@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.

daylightstudio commented 8 years ago

@Crispy1975 ... good to know. Thanks.

valeria-melinte commented 8 years ago

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

daylightstudio commented 8 years ago

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

kristdev commented 8 years ago

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

rikkouri commented 8 years ago

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