TutorialMS Community Forum

Full Version: BUG #20: Removing sub-cats bug [SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm still trying to set up a tutorial directory and have just renamed a few of the categories and subcategories. I also deleted some subcategories and added some. After renaming, the tutorial count for each subcategory has changed to zero, regardless of how many tutorials are actually in that category.
In left side navigation, the category shows the actual number of tutorials for that category, but all subcategories show 0. This occurs for ALL subcategories, even those that didn't get renamed.

At the same time, all tutorial listings (center column) get changed to a RANDOM subcategory...regardless of what the top level category is. In other words....the tutorial listing may show correct category, but subcategory is incorrect. Listed subcategory does not even exist under that category.

View at http://air-dry-clay.com/directory/tutorials/
(note....if viewing with Firefox, I have other layout issues which display page badly in FF but OK in IE)

There are 96 tutorials in database and they are now ALL listed as being in How to DVDs for sale or rent even though ZERO is actual count for that subcategory
(every tutorial listed belongs in other categories, not just other subcategories).

This also happened about a week or 2 ago. At that time I was also having host/server problems with PHP in general. Website is now on brand new server and, after manually changing all categories back to the original, the naming & count errors occurred again immediately after renaming a few categories/subcategories. Is this a script problem or a PHP problem?

Also, the new, re-named categories in left column are no longer in alphabetical order. I've hunted for typos and extra spaces for those that are out of sequence but can't find any.
Hmm I am getting the impression that this may not be a php error but perhaps a database error. By what I understand you said that you have only been changing the Categories and Subcategories names which should not effect the php source code considering the tutorials are stored inside your database.

I would suggest you check your database and browse tutorial_front. Then take a look at your tutorials and verify whether they are set to the correct main and sub categories (check the values of mcate and scate).

Let us know what you find.
Hey Mary,
Were you able to check the database to see if this resolved your problem?
Quote:Let us know what you find

Well, Canadian, I found that "The databases themselves are not easily read by humans" Big Grin That's a quote from MySQL...LOL But seriously, I don't know where to look for the values of mcate and scate. When I go into CPanel/MySQL I only see 2 options...to Check DB or Repair DB and both those options are automated functions. I used Check DB and it reported no errors or corruption.

But I believe the database is intact in that all tutorials are there and will show up on the "all active tutorials" page. It's just that when I renamed a few subcategories thru the Admin area, ALL subcategories got renamed...and ALL got renamed to the wrong subcategory. They don't appear to have actually been moved....just renamed. The subcategory name they were all given currently contains ZERO tutorials.

This is the second time this has happened. The first time, they all got renamed to a different subcategory than the second time. In addition, the first time it happened the website was on a different server with a different host and different CPanel. That's what makes me think it's a tutorialMS problem.

Today I'm going to manually change all the subcategories back to their original name, so I have created a web page with screenshots explaining the error. http://air-dry-clay.com/errors.html I hope you can enlighten me as to what might be causing this error.
Thanks, Mary
Hmmm, that is strange. I would still think it may be a database issue. You haven't made any changes to the source code and the tutorials are stored inside your database. Under each tutortial in the database when you click on one you can find out if they are pointed to the proper Category/Subcategory and so on. I would worry about trying to eliminate the possibility of a database issue before you go any further.

If you know how to access your database you want to look under the table called tutorial_front. You must now pick a tutorial (use tutname to find out which tutorial is which) and check the values of mcate and scate. mcate stands for main category while scate stands for subcategory. If they are correct they will correspond to the name of you main or subcategory. For example if you put a "How to work DOS" tutorial under a main category of your site named "Computers" and subcategory named "DOS" your mcate will say Computers and scate will say DOS.

It may have been possible that your database did not properly change the values after renaming the sub and main categories which is causing some or all tutorials to not be in the proper location. You wouldn't recieve an error in your database because as far as the database is concerned no data is corrupted or wrong. Every tutorial will still have a main and subcategory, but chances are it is pointing to the wrong location.
Hopefully this can resolve your issue Mary. Perhaps someone else might be able to give their advice on the situation.
This bug has been solved for the next version. The exact cause was when you delete a sub-category and then click to move the tutorials to another sub-category, it would change every tutorial to that sub-category, regardless of the category or sub-category it was originally in.
Reference URL's