Results 1 to 9 of 9
  1. #1
    Join Date
    May 2008
    Posts
    23
    Plugin Contributions
    0

    Default Please Help... Site shows constant names instead of content.

    OK, this is weird. I've completely horked my site, and I have no idea where or how.

    I was editing some files, mainly template and stylesheet related and everything was going great. This is on a locally hosted development server with no other users. I was really pleased with the progress I was making, in fact. I was following the recommendations on overrides, etc.

    I go for a dinner break and sit back down at my desk to continue editing. Before making any edits, I refresh the page, and suddenly much of the content has been substituted with constant names. For instance, my main menu now reads:

    HEADER_TITLE_LOGOFF HEADER_TITLE_MY_ACCOUNT and so forth...

    The page header now shows HEADER_SALES_TEXT and HEADER_ALT_TEXT, etc.

    Same thing in lots of other places. The site is suddenly horribly broken and I have no idea what I might have done to make it that way. They're obviously language constants.. The files I had open for editing were:

    /includes/languages/english/html_includes/mysite/define_main_page.php
    /includes/languages/english/mysite/header.php
    /languages/english/mysite/index.php
    /includes/templates/mysite/css/stylesheet.css
    /includes/templates/mysite/templates/tpl_product_info_display.php
    /includes/templates/mysite/common/tpl_main_page.php
    /includes/templates/mysite/template_info.php

    It looks like I broke something related to the language files, but why didn't it show up earlier? I've gone back and undone the last few changes I made in each file, but to no avail. How can I find what broke and where?

    I'd be very grateful for any advice...

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Please Help... Site shows constant names instead of content.

    Generally this happens when you don't leave the ' ' when you delete the contents of a define statement. Check the index.php file first.

    If you don't want the "Congratulations...", line 52 should look like this:

    define('HEADING_TITLE', ''); Note the single quotes.

  3. #3
    Join Date
    May 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: Please Help... Site shows constant names instead of content.

    Thanks stevesh! I checked and I don't think that's it. I just did a fresh install using the same configure.php and it's doing the same thing. I wonder if the db could have gotten corrupted somehow? The admin shows only a blank page, for instance. Snooping around in phpmyadmin doesn't show anything obviously wrong, but I'm not certain I'd know what to look for. What's so strange is that I'm sure I had refreshed the page before heading to dinner and everything was fine. When I came back my session had probably expired and when I refreshed, everything broke. Very strange indeed...

    Any more ideas? Thanks so much for the quick reply. :-)

  4. #4
    Join Date
    Jul 2005
    Posts
    537
    Plugin Contributions
    0

    Default Re: Please Help... Site shows constant names instead of content.

    I looked up these issues in the FAQ area:
    Constant Names showing instead of text: https://www.zen-cart.com/tutorials/index.php?article=95
    Getting blank pages: https://www.zen-cart.com/tutorials/index.php?article=82

  5. #5
    Join Date
    May 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: Please Help... Site shows constant names instead of content.

    Thanks Chuck! I've been looking through the FAQs and I still haven't hit it yet. I was doing some very innocuous edits in the files, and so I think it may have been an admin setting instead... I did find this appearing in my error_log when I returned from my break:

    [Sat May 17 22:05:07 2008] [error] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/languages/mysite.net.php' (include_path='.:/usr/local/php5/lib/php') in /path/to/mysite.net/htdocs/cart/admin/includes/init_includes/init_languages.php on line 31

    That file is indeed not there. Nor was it ever there as far as I know, yet prior to my break those errors were not appearing. I do have a languages/english/mysite.net folder where I've got my updated header.php and index.php files.

    Is it possible I broke a path in the admin which is bringing everything else down? Both things happened simultaneously, so I'm sure there's a common failure point.

  6. #6
    Join Date
    May 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: Please Help... Site shows constant names instead of content.

    Yes, that looks like the case. I've done a fresh install, including all files and a fresh database which works fine as you would expect.

    In configure.php I switch from the fresh database to my original one, and BAM! It all falls apart. So it's not just a file typo. It's a path problem or something similar in the database.

    Now, the question is what to change and where. :-(

    I'm pretty handy with MySQL and phpmyadmin, and I suspect the trouble lies with the language settings...

  7. #7
    Join Date
    May 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: Please Help... Site shows constant names instead of content.

    An excerpt from my admin_activity_log table right before things fell to pieces:

    | 539 | 2008-05-17 16:51:52 | 1 | product_types.php | gID=&cID=7&ptID=1&action=layout& | 127.0.0.1 |
    | 540 | 2008-05-17 16:52:08 | 1 | configuration.php | gID=1& | 127.0.0.1 |
    | 541 | 2008-05-17 16:54:32 | 1 | alt_nav.php | | 127.0.0.1 |
    | 542 | 2008-05-17 16:54:34 | 1 | alt_nav.php | | 127.0.0.1 |
    | 543 | 2008-05-17 16:54:42 | 1 | configuration.php | gID=19& | 127.0.0.1 |
    | 544 | 2008-05-17 16:55:11 | 1 | categories.php | | 127.0.0.1 |
    | 545 | 2008-05-17 16:55:31 | 1 | store_manager.php | | 127.0.0.1 |
    | 546 | 2008-05-17 16:55:54 | 1 | configuration.php | gID=18& | 127.0.0.1 |

    Any other gems of wisdom before I start reconfiguring my ZC installation from scratch? gID=18 is the Product Info configuration page. I know that's the last thing that was edited, as when I came back I only get a blank page for the admin. I had looked at the items in store_manager.php but did not make any changes.
    Last edited by Gwixel; 18 May 2008 at 04:46 AM.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Please Help... Site shows constant names instead of content.

    A comparison of what files are different or "extra" between the two installs is your best bet:
    http://www.zen-cart.com/wiki/index.p...Obscure_Issues

    One thing you might try is to actually create the file it says is missing. Just put <?php on the first line of the file and save it. Then see what happens. Once you get into your admin, then try going to Admin->Localization->Languages and delete your "mysite.net" language from the list. Then what happens to storefront and admin? Then delete the new file you created, and see what happens to the admin?

    I suspect the problem is not really database-related other than that the database has stored information about your defined languages and is attempting to bring up appropriately related files for that language.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    May 2008
    Posts
    23
    Plugin Contributions
    0

    Default Re: Please Help... Site shows constant names instead of content.

    Fixed!

    Here's what worked. Creating the "missing" file didn't do anything, but deleting the entry in the languages table worked AFTER I quit the browser to empty the cache. I also cleared the entry in the db_cache table but I'm not sure if that was useful or not. The relevant line in the debug log was:

    [19-May-2008 13:23:40] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/mysite.net.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /path/to/mysite.net/htdocs/cart/includes/init_includes/init_templates.php on line 72

    That particular line checks for the proper language directory to be stored in the user's session. I think what possibly happened is that I changed the setting in the admin to activate my new language files, then left for my break without completing some operation or another (It's all lost in the fog of war now!) and when I returned several hours later my session had expired. There was now a mismatch somewhere which caused things to instantly break upon a refresh.

    Although I obviously triggered this to happen, it seems as though something could be made more robust to prevent this kind of thing from happening in the future.

    In any case, thanks for your help and advice, and I hope this thread can help others who may find themselves in this situation.

 

 

Similar Threads

  1. Pictures instead of Names
    By Maynards in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Mar 2011, 04:01 PM
  2. please help - my template shows up just text
    By stormysar in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 20 May 2007, 02:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg