How to Break Your Site In One Easy Step |
Written on Jul 24, 2014 by Steven |
The Mistake The Discovery The CMS I use drives the category list from a file based on its name. I pulled up the news file and it only had a single article listed in it. I knew that was wrong because the news file should have a number of articles I've added to it over the years. Perplexed I tried to bring up the writing category. Wait, there wasn't one. Then I remembered my earlier decision to use the news category's picture. Instead of picking a creating a new category called “Writing” with the same picture as the news category, I’d actually used the same news file twice with two different category names. The program didn’t know how to deal with this, nor did it prevent it from occurring. At this point, I realized I made a serious mistake. The Fix The next problem I faced was moving articles back into the right categories. When I tried to move missing articles into the files it didn’t work. I figured out that the program drives the article list from the category files. If the article isn’t in the file, it doesn’t really exist. I was back to editing files. This poses a problem because if a topic isn't in one of those files, the CMS won’t display it. Fortunately, I had an old copy of the news file. Although a good start, and I was able to fix the missing newer articles, I was still missing quite a few topics. No big deal, I thought, I’ll just pull up the full article list. If the article didn't show in the list, I knew that it was the one I needed to add back. Then I ran into another problem. As you create an article the program adds a number to identify it. However, the function that lists the articles sorted the articles by the category they’re in, not by their number. Nice, I get to program again. I edited the routine to sort the list the way I wanted it to and, after a few tests, had a nice list of articles. Sure, it would have been easier to just list the topics not in an a category. unfortunately, that would have required a lot more effort. I opted for the more direct approach, just searching the list for missing numbers. After a few minutes of cutting and pasting I had my site back to normal. Mistake corrected. The Future For now, I think I’m just going to stick with writing articles and working on other projects. Eventually I’ll make a decision to move to something else, but until then I’ll just have to live with a few bugs. The moral of this story is don’t cut corners. Now where was I at in my novel? |
The comments are owned by the poster. We aren't responsible for its content. |