Howdy, All,
After upgrading from 1.3.6 to 1.3.7, I noticed some strange behavior between my local development and live web versions of the store, having to do with displaying new items.
Alas, it's possible this was going on before & I just didn't notice it...
The store is set up not to display new items on the index page (admin/configuration/index listing = 0,0,0,0,1,2,3,4,1,2,3,4,1,2,3,4,3,3,3,1)
However, there is a hard-coded define in /includes/languages/english/index.php:
define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>! Would you like to see our <a href="%s">newest additions</a>?');
Which shows the logged-in user a link for showing new items, no matter what the index listing settings may be.
On the live site this bombs (*REMOVED* is the hard path to the live store...)
##############################################################################################################
Warning: Division by zero in *REMOVED*/includes/classes/split_page_results.php on line 76
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, 0' at line 10
in:
[SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status FROM zen_products p LEFT JOIN zen_manufacturers m ON (p.manufacturers_id = m.manufacturers_id), zen_products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by p.products_date_added DESC, pd.products_name limit -0, 0]
##############################################################################################################
Am guessing that since new additions is turned off in admin, some code is supplying zero to the $number_of_rows_per_page var that's passed to the splitPageResults class, causing SQL to break when it tries to divide.
Odd thing is I get different behavior on the local test store. There, it *does* try to display the new additions page, but the fonts are all out of whack, way too big, and under the "Sort By" dropdown, right-justified, I get a "-4 -3 -2 -1 0" (no quotes) with the zero in black & the other numbers in a different color.
I tried changing all the index listing vars to zero (except for the 3 'columns per row' settings toward the bottom) but that had no effect on either the dev or live version.
Code-wise, the local dev & live sites are the same, except for a couple of path definitions in configure.php.
Versions of OS / Apache / PHP / MySQL:
Local: CYGWIN_NT-5.1 1.5.22(0.156/4/2) / 2.2.3 / 5.2.0 / 5.0.27-community
Live: Linux 2.6.9999 / 1.3.37 / 4.2.1 / 5.1.4
Anyone else seeing this behavior?
For now, the kludge, er, ah, *solution* is simply to override the new additions link in TEXT_GREETING_PERSONAL.
Still, I'm a little curious why the same code would produce two different effects.
Again, the code for the local & live versions is the same. Thanks to the override system, I was able to simply copy the entire new 1.3.7 fileset into the local version, upgrade the database, verify things seemed to be working OK, then repeat for the live version.
Take care!
--
Carl



