Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Odd link problem after upgrade

    I'm not sure if this started immediately after a recent upgrade to 1.3.9h or later, but we just noticed it.

    On this site, if you scroll down to the bottom of the home page to the New Products For May box, and hover over any of the products, you'll see a slight difference in the text links compared to the image links. For example...

    Code:
    text link:  ../index.php?main_page=product_info&cPath=130&products_id=964
    image link: ../index.php?main_page=product_info&cPath=130&products_id=964
    Just before the products id in the text link (but not in the image link) the normal ampersand is being changed into an HTML entity and then the link doesn't work. Oddly, the ampersand for the category is not being changed.

    If you check out any other listing, for a category for example, or even by following the New Products... link under the categories, all the links look and work correctly. It's only wherever you have a New Products For May box that the links are wonky.

    So I guess my question is... where is the code that is outputting those links? I'll need to check that php file against a stock one to see what's wrong, but I don't know where to start.

    Thanks for any hints you can offer.

    Rob

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Odd link problem after upgrade

    Quote Originally Posted by rstevenson View Post
    So I guess my question is... where is the code that is outputting those links? I'll need to check that php file against a stock one to see what's wrong, but I don't know where to start.
    /includes/modules/new_products.php

    Not sure if that'll be the offending file, but it appears to be a good place to start.

    Cheers
    Rod

    ps. Followed this further... also check /includes/init_includes/init_canonical.php
    Last edited by RodG; 10 May 2012 at 01:35 PM.

  3. #3
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Odd link problem after upgrade

    Thanks Rod. The init_canonical.php file is identical to a stock one. However, the new_products.php file is part of the Single Listing Template add-on, which also installed a modified version of includes/templates/MY_TEMPLATE/templates/tpl_products_new_default.php. I could try removing that mod, but would prefer to run it, of course. It doesn't seem to have a switch in admin to turn it off for testing, but it does have a debug function. I'll turn that on and have a look.

    Rob

  4. #4
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Odd link problem after upgrade

    If it were me, I'd just rename includes/templates/MY_TEMPLATE/templates/tpl_products_new_default.php which will cause zen to use the original template. It'll probably screw up the look of the page, but it'll prove or elimate this file as being the culprit. (I call this the 'fck all to infinity' check). :)

    Cheers
    Rod

  5. #5
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Odd link problem after upgrade

    Nope, no debug function. The readme says to "enable the Admin->Configuration->Index Listing - Template Debugging = True and see what files are being used." Unfortunately there is no such setting. Something is amiss. Must go check the files now. [sigh]

    But I like your 'fck all to infinity' check. I'll try that too. >>>

    Tried that and the New Products... listing returned to one product per row, as expected. But the New Products For May box didn't change and the links remained wonky. But that's an interesting technique. I'll have to remember that one.

    Rob
    Last edited by rstevenson; 10 May 2012 at 02:09 PM.

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Odd link problem after upgrade

    Quote Originally Posted by rstevenson View Post
    But I like your 'fck all to infinity' check. I'll try that too.
    That was taught to ne by my electronics teacher several decades ago. Initially as a way to determine what would happen at point 'A' of a circuit if resistor 'B' was increased or decreased in value. Instead of trying to figure the answer out using minor changes, the idea was to figure it out as if the resistor had a dead short (fck all resistance, and again as if the resister was open circuit (infinite resistance). These 'figures' made it easy to see what the answer would be. Any values in between those two was just a matter of degree.

    This same princple works with many other real world situations as well. :)

    Anyway, I digress...

    Another place for you to check would be

    /includes/functions/functions_categories.php
    This may be counter intuitive but 'new products' appear to be processed just like any other category.

    Incidently, when you've fixed this problem, I think it about time you updated Johanne's shipping module. <smiles> I see she's still using one of the V2.x.x series.
    The V3.x.x series is an easy upgrade (just copy over the new files, and navigate to the admin settings). The act of navigating to the admin settings will automatically update the database files whilst keeping most, if not all, of her current settings intact).
    One of the biggest benefits she will gain is a performance boost and increased reliabilty. V2 only 'knows' about one of our three servers. V3 knows about them all.

    Cheers
    Rod

  7. #7
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Odd link problem after upgrade

    Another place for you to check would be
    /includes/functions/functions_categories.php
    Nope, that one's stock too.

    Rob

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Odd link problem after upgrade

    Just done a bit more investigationing, and have found;

    /includes/modules/new_products.php is the *only* file that has a reference to class=centerBoxContentsNew, which if you view the offending page source is the class id used in the faulty output.

    Furthermore, line#72 of this file (V1.3.9 distro) has the following code:

    ------------------------------------
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);
    ------------------------------------------------------------

    Take special note of the ampersands immediately preceeding the "products_id=". I'm wondering if these are somehow related to the problem. Using my fck all to infinity technique, try removing them and see what effects (if any) it has on the offending page. I'd also go as far to suggest that you change "products_id" to something like "PRODUCTS_ID".
    Yes, this WILL break things big time, but all being well, when you view the source (or hover over the links) you'll see quite clearly if we are on the right path or not. If nothing changes, put things back and we'll need to start looking elsewhere. If you see the changes reflected on the page we'll know that we are at least getting a little closer to the problem

    Good luck... I'm about to call it a night (1am here, again).

    Cheers
    Rod

  9. #9
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Odd link problem after upgrade

    Thanks Rod. I'll give that a try, though as I mentioned before, that file is stock right out of the clean untouched copy of ZC 1.3.9h I always keep handy for times such as this.

    Rob

  10. #10
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Odd link problem after upgrade

    Quote Originally Posted by rstevenson View Post
    Thanks Rod. I'll give that a try, though as I mentioned before, that file is stock right out of the clean untouched copy of ZC 1.3.9h I always keep handy for times such as this.

    Rob
    Didn't want to mislead you. I wasn't stating that this file was the one causing the problem, it is just a 'convenient' one to start debugging with :)

    Anyway, I've done those tests (and more) on my own system, and can confirm that this is indeed the page where the links are being created, BUT, somewhere between here and the page output appears to be having a bit of sanitation applied, and it appears that this code (whereever it is) is the culprit.

    What I found (FYI) is that removing the ampersand breaks things (as I expected), BUT, if I add several of them (eg "&&&&&product_id") all but one of them get stripped out. No sign of them being converted to &amps; though. For further testing I replaced the first one with "&&&&X&&&&products_id" and the other with "&&&&Y&&&&products_id" -- and the output was the same type of sanitation... IOW, the output became "&X&products_id" & "&Y&products_id"

    So, where to go from here.... for me, it's definelty bed :)

    For you.... Hard to say... From this point on, I would be loading up my IDE (netbeans), adding a break on this line, then literally stepping through the code to see where this 'sanitation' is taking place and where it is getting htmlalised.

    It is not much point in my doing this with my test site though, because mine doesn't exhibit the same problem as yours (I've tried both V1.3.9 and V1.5.0).

    In short, I think I've now taken this as far as I can with you.... UNLESS perhaps you find if you make the same edits as I did and get entirely different results...

    Cheers
    Rod

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v153 After upgrade to 1.5.3 Unable to determine the page link!
    By rhrobert in forum General Questions
    Replies: 4
    Last Post: 10 Aug 2014, 05:27 AM
  2. Odd problem with configure.php when trying to upgrade
    By canemasters in forum Upgrading to 1.5.x
    Replies: 4
    Last Post: 19 Mar 2012, 07:16 PM
  3. Problem with odd link showing up on home page..
    By JennH in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Apr 2010, 12:48 AM
  4. A very odd link problem. Help?
    By jaggers in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Nov 2007, 03:16 PM
  5. EZ Page link missing from admin>tools after upgrade
    By craftzombie in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 16 Dec 2006, 02:43 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR