Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default [Not a bug] Language overwrite bug?

    I dont know if this is a bug, or probably just me doing something stupid.

    I have
    includes/languages/english/advanced_search_result.php
    includes/languages/english/mytemplate/advanced_search_result.php

    I expected on the file in mytemplate to be loaded, but it seems like both of they are loaded? Am I doing something wrong here?
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Language overwrite bug?

    No, it is not a bug.
    The custom language file is loaded first.
    Then the master language file is loaded afterward ... just in case an out-of-date language file is used in override.

    Most upgraders tend to not be thorough, and miss merging things in their language files.
    Thus, at the present time, the default master file is also loaded to "catch" any defines that haven't been set properly in the override language file.
    This only happens on "page-based" language files, not module-based files.

    And, yes, doing things this way causes PHP warnings about "constant already defined". It's a cost of protecting upgraders from their own mistakes.

    For now, that's how it's done.
    It may change in the future.
    .

    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.

  3. #3
    Join Date
    May 2005
    Location
    Bath, Somerset
    Posts
    1,053
    Plugin Contributions
    3

    Default Re: [Not a bug] Language overwrite bug?

    Would it be possible to create a new zen_define() function, with a global option to check if the constant has already been defined?

    The reason for having this as an global option, rather than a permanent feature is that it would obviously add a small amount of time to each page load, and where users are running sites where fast page loads are essential, or slow shared hosts, the page load times are always a concern.

    Thank you,

    Absolute

 

 

Similar Threads

  1. Replies: 4
    Last Post: 24 Jul 2010, 01:06 PM
  2. [NOT A BUG] Minor bug in account edit template
    By jdcncsolutions in forum Bug Reports
    Replies: 3
    Last Post: 2 May 2010, 01:37 AM
  3. [Not a bug] language define conflict
    By TheHYPO in forum Bug Reports
    Replies: 4
    Last Post: 28 Aug 2008, 07:34 AM
  4. [not a bug] Language directory error
    By GwaiTsi in forum Addon Language Packs
    Replies: 5
    Last Post: 20 Feb 2007, 10:26 AM
  5. [Not a Bug] EZ-Page Links IE bug when first clicking
    By NamSingh in forum Bug Reports
    Replies: 11
    Last Post: 25 Dec 2006, 03:40 PM

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