Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Upgrading from 1.3.7 - help please!

Upgrading from 1.3.7 - help please!

Views: 1,231

Results 1 to 5 of 5
15 Oct 2011, 7:13 PM
#1
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Upgrading from 1.3.7 - help please!

In the process of upgrading from 1.3.7. Doing an upgrade on the test site (which is mirror of live site) first. Am at the Winmerge stage and need to clarify a few things so as usual, forgive the stoopid newbie questions. I find if I keep reading/asking questions all of a sudden things suddenly drop into place and I understand what I'm doing and why which makes everything so much easier (and I want to learn rather than follow instructions if you see what I mean) so please bear with me while I reach that point :blush:

First set of dumb questions:

  1. I've looked at all the ChangeLogs between 1.3.7 and 1.3.9h (I assume this is necessary?) - there are obviously a lot of files that have been changed. Am I right in saying that, when I compare the original version of 1.3.7 (zen_orig) to the current live 1.3.7 (zen_backup), those files listed in the changelogs which have not been customised/altered can simply be overwritten?

  2. I can't seem to get it straight in my head how the upgrade works with the override system. The override files are obviously based on the 1.3.7 files. Do I:

    • compare zen_orig with the override files and make note of changes
    • then add those changes into the 1.3.9h files and save them as the new override files
    • any files in the override which have not been changed since 1.3.7 can be left as is
      I'm pretty sure I'm making this far more complicated than it needs to be but it's not making sense at the moment and I'm annoyed with myself. Hoping someone can make the penny drop for me.

TIA :smile:

15 Oct 2011, 9:31 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

Re: Upgrading from 1.3.7 - help please!

You can let your penny drop. You have grasped the principals of both your questions correctly.

Feel free to come back with any problems you run into.

:thumbsup:

16 Oct 2011, 9:57 AM
#3
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Re: Upgrading from 1.3.7 - help please!

Thank you so much Kim, very reassuring to know it's starting to make sense!

I've started adding in changes (not got to the override files yet), there are rather a lot. So far most of the changes have been minor, only one or two lines, but I'm now looking at admin/categories.php in WinMerge and there are large sections of code that are different. I just want to check that I would be doing the right thing by changing it.

For example. The code in the original 1.3.7 categories.php file starting at line 216 is:

      if ($_POST['categories_image_manual'] != '') {
        // add image manually
        $categories_image_name = $_POST['img_dir'] . $_POST['categories_image_manual'];
        $db->Execute("update " . TABLE_CATEGORIES . "
                      set categories_image = '" . $categories_image_name . "'
                      where categories_id = '" . (int)$categories_id . "'");
      } else {
        if ($categories_image = new upload('categories_image')) {
          $categories_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
          if ($categories_image->parse() && $categories_image->save()) {
            $categories_image_name = $_POST['img_dir'] . $categories_image->filename;
          }
          if ($categories_image->filename != 'none' && $categories_image->filename != '' && $_POST['image_delete'] != 1) {
            // save filename when not set to none and not blank
            $db->Execute("update " . TABLE_CATEGORIES . "
                          set categories_image = '" . $categories_image_name . "'
                          where categories_id = '" . (int)$categories_id . "'");
          } else {
            // remove filename when set to none and not blank
            if ($categories_image->filename != '' || $_POST['image_delete'] == 1) {
              $db->Execute("update " . TABLE_CATEGORIES . "
                            set categories_image = ''
                            where categories_id = '" . (int)$categories_id . "'");
            }

The current live site version of the file at that point is:

      if ($categories_image = new upload('categories_image')) {
        $categories_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']);
        if ($categories_image->parse() && $categories_image->save()) {
          $categories_image_name = $_POST['img_dir'] . $categories_image->filename;
        }
        if ($categories_image->filename != 'none' && $categories_image->filename != '' && $_POST['image_delete'] != 1) {
          // save filename when not set to none and not blank
          $db->Execute("update " . TABLE_CATEGORIES . "
                        set categories_image = '" . $categories_image_name . "'
                        where categories_id = '" . (int)$categories_id . "'");
        } else {
          // remove filename when set to none and not blank
          if ($categories_image->filename != '' || $_POST['image_delete'] == 1) {
            $db->Execute("update " . TABLE_CATEGORIES . "
                          set categories_image = ''
                          where categories_id = '" . (int)$categories_id . "'");

It looks as though sections of code from the original file have been removed. Comparing the originial 1.3.7 file with the 1.3.9h version, that section of code appears to be identical. The site is highly customised and there have been a lot of mods installed (before my time so I don't have a complete list) but I can't identify the source of that change and my understanding of php is rather limited. I realise it's purely a confidence issue but I just wanted to double check before I change this....

Many thanks

16 Oct 2011, 3:49 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

Re: Upgrading from 1.3.7 - help please!

Is the site using the category images? It appears that instead of using the Admin facilities and templates to change the showing of the category image that someone changed/removed the code. I would use the stock 1.3.9h code and see if I could make the changes to the look via more conventional means.

16 Oct 2011, 7:18 PM
#5
lidders avatar

lidders

New Zenner

Join Date:
Sep 2010
Location:
UK
Posts:
23
Plugin Contributions:
0

Re: Upgrading from 1.3.7 - help please!

Kim:

Is the site using the category images? It appears that instead of using the Admin facilities and templates to change the showing of the category image that someone changed/removed the code. I would use the stock 1.3.9h code and see if I could make the changes to the look via more conventional means.

Thank you for the advice, that sounds like a sensible solution. I will use the basic code and then fiddle about afterwards. As a test I uploaded the basic 1.3.7 version of that file to the test site and couldn't see any difference in the category pages so I'm none the wiser. There are category images but I don't know how different they are to the basic template. :unsure:

I confess I'm now worried how many other changes have been put in like this. Oh well, all part of the learning curve!

Thanks again, I appreciate the virtual hand holding!