Advertisement:

Author Topic: Link broken if category is empty  (Read 5722 times)

ipuck

  • Newbie
  • *
  • Posts: 46
Link broken if category is empty
« on: March 12, 2013, 10:58:47 am »
For some reason the page will not show if the category is empty. It only happens with Internet Explorer 9 or 10 and start happening after upgrading to 3.1. Chrome, Safari and FF is OK. Try clearing page cache and still have problem. If I add a test post to the category it will work OK.

Test site: http://clasificadosus.com/

infernet

  • Newbie
  • *
  • Posts: 10
Re: Link broken if category is empty
« Reply #1 on: March 16, 2013, 09:14:52 pm »
Duplicate from http://forums.osclass.org/general-help/(bug)-city-filter-returns-404-despite-articles-published/

I am still waiting for an answer too. The bug also appears when pages have articles.

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Link broken if category is empty
« Reply #2 on: March 19, 2013, 12:05:02 pm »
I cannot reproduce this error... for me it's rendering ok the 404 errors in IE9 and IE10. Even your website. Here are two example:
    - From my local machine: http://imgur.com/P6C7GXm
    - From your website: http://imgur.com/RssdHbJ

Getting an HTTP 404 error is ok because that page is not getting any results... So I'm not sure if that's what you're trying to say or it's something more. But without any screenshot and without reproducing the error I don't know what it can be.

@infernet: we've fixed that error, I'm answering you in your thread :)

ipuck

  • Newbie
  • *
  • Posts: 46
Re: Link broken if category is empty
« Reply #3 on: March 20, 2013, 09:53:26 pm »
@Juan Ramón

Thank you for answering.

I didn't upload any images because there is nothing to show, but this is what I get.

BTW, I did try with a third computer using Windows XP and it is working OK, so there must be something with my computer or with IE9 and IE10.

Here is my concern. If it happens with my IE10, what are the chances that other people are having the same problem. New users may not have the problem, but returning users will.

Just a thought.

Thanks for your time and this great product.

stevekane

  • Newbie
  • *
  • Posts: 9
Re: Link broken if category is empty
« Reply #4 on: March 23, 2013, 10:38:29 am »
I have the same problem in ie9 so today I updated to ie10 and the problem remains - only on  categories or sub categories which are empty,  The results vary

http://www.3d-cases.co.uk/second-hand-flight-cases/

It works fine in other browsers.

ipuck

  • Newbie
  • *
  • Posts: 46
Re: Link broken if category is empty
« Reply #5 on: March 24, 2013, 06:36:21 am »
I'm glad I'm not the only one. That means that I'm not crazy ;-)

stevekane

  • Newbie
  • *
  • Posts: 9
Re: Link broken if category is empty
« Reply #6 on: March 25, 2013, 02:14:56 am »
ipuck
That means i'm not crazy !

yooads

  • Newbie
  • *
  • Posts: 25
Re: Link broken if category is empty
« Reply #7 on: April 04, 2013, 03:10:21 pm »
I have the same issue. If a sub-category is empty, I get a 404 Page not found when click.

here is example: The main page is: http://yoo.ro/ Then, is the left category, click on Apartamente 4+ camere (0) , url is http://yoo.ro/imobiliare-vanzari/apartamente-4-camere

Jan86

  • Full Member
  • ***
  • Posts: 196
Re: Link broken if category is empty
« Reply #8 on: May 23, 2013, 07:55:27 pm »
I have same problem! :-/ All themes in IE when category is empty link broken ... show page withou css look relly bad.....
« Last Edit: May 23, 2013, 08:01:33 pm by Jan86 »

Aficionado

  • Guest
Re: Link broken if category is empty
« Reply #9 on: May 23, 2013, 10:15:51 pm »

Getting an HTTP 404 error is ok because that page is not getting any results... So I'm not sure if that's what you're trying to say or it's something more.


This is PLAIN WRONG.

A new Osclass website will NEVER rank if full of 404 errors. NEVER.

This is a very - very bad practice.



Jan86

  • Full Member
  • ***
  • Posts: 196
Re: Link broken if category is empty (HELP SOLVED POST)
« Reply #10 on: May 23, 2013, 11:16:52 pm »
Now i tested in version 2.4.1 and its works perfect in ie and all browsers.. Empty category link on normal search page "no search result"... In new 3.1.2 look relly bad.. like without css style....


This solved my problem!   http://forums.osclass.org/3-1-x/3-1-1-search-bug-404-page-not-found/
« Last Edit: May 24, 2013, 12:35:57 am by Jan86 »

Olivia

  • Newbie
  • *
  • Posts: 17
Re: Link broken if category is empty
« Reply #11 on: May 28, 2013, 01:46:50 am »
The way to fix getting a 404 error page when your categories are empty which is included in the above link, is simply this:

Locate your 'search.php' file located here:
/oc-includes/osclass/controller/search.php

Find this line of code:
                if( count($aItems) === 0 ) {

And replace it with this line of code...
                if( count($aItems) === -1 ) {

Basically you're taking out the "0" and replacing it with a "-1".

I have personally used this and it is working for me with no negative side effects. Hopefully it will work for everyone else having this same issue!!

AliFarooq

  • Newbie
  • *
  • Posts: 1
Re: Link broken if category is empty
« Reply #12 on: February 07, 2014, 09:09:23 pm »
I had a similar issue, turns out that it was a settings issue. My categories links were appearing without the main domain name like "for-sale./" i went to settings and then Advanced. In Advanced Settings I had subdomain type selected as "Category Based" I changed it back to no subdomains and saved to resolve the issue.
May be it can be helpful to someone new as me :)

onlineservices

  • Newbie
  • *
  • Posts: 22
Re: Link broken if category is empty
« Reply #13 on: March 15, 2018, 09:06:59 pm »
Olivia statement is right - It worked for me.
Quote
The way to fix getting a 404 error page when your categories are empty which is included in the above link, is simply this:

Locate your 'search.php' file located here:
/oc-includes/osclass/controller/search.php

Find this line of code:
                if( count($aItems) === 0 ) {

And replace it with this line of code...
                if( count($aItems) === -1 ) {

Basically you're taking out the "0" and replacing it with a "-1".

I have personally used this and it is working for me with no negative side effects. Hopefully it will work for everyone else having this same issue!!