History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: OSC-845
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: James Anderson
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
osCommerce Core

Templates-> Template Modules -> Boxes Bug

Created: 19/Mar/09 10:57 PM   Updated: 01/Aug/09 03:57 PM
Component/s: Template Structure
Affects Version/s: 3.0 Alpha 5
Fix Version/s: None

Environment: linux


 Description  « Hide
When you click on Templates-> Templates Modules -> Boxes and edit anything in that admin area, what happens is the front-end of your store completely screws up, and titles change to variable names.

 All   Comments   Change History      Sort Order:
Frans van Berckel [23/Mar/09 01:52 PM]
Hi James,

What would you change in the logic we are using now?

* Copy the default template and / or save your changes as by name xyz.
* Binding a temp template and having a preview before setting the default.

PS [01/Aug/09 03:57 PM]
Change the two functions like below. This happens because function getData in also defined in the higher class osC_Language_Admin which subtends osC_Language and is conflicting. Also comment out setCache line because the higher class is already caching. This function getData is not used anywhere else when I checked so you can safely change its name :o)

catalog/includes/classes/language.php

    function load($key, $language_code = null) {
      global $osC_Database;

      if ( is_null($language_code) ) {

        $language_code = $this->_code;
      }

      if ( $this->_languages[$language_code]['parent_id'] > 0 ) {
        $this->load($key, $this->getCodeFromID($this->_languages[$language_code]['parent_id']));
      }

      $Qdef = $osC_Database->query('select * from :table_languages_definitions where languages_id = :languages_id and content_group = :content_group');
      $Qdef->bindTable(':table_languages_definitions', TABLE_LANGUAGES_DEFINITIONS);
// $Qdef->bindInt(':languages_id', $this->getData('id', $language_code));
      $Qdef->bindInt(':languages_id', $this->getInfo('id', $language_code));
      $Qdef->bindValue(':content_group', $key);
// $Qdef->setCache('languages-' . $language_code . '-' . $key);
      $Qdef->execute();

      while ($Qdef->next()) {
        $this->_definitions[$Qdef->value('definition_key')] = $Qdef->value('definition_value');
      }

      $Qdef->freeResult();
    }
.
.
.
.
.
// function getData($key, $language = '') {
    function getInfo($key, $language = '') {
      if (empty($language)) {
        $language = $this->_code;
      }

      return $this->_languages[$language][$key];
    }