Zen Cart Logo
Forums / Bug Reports / 1.5.6c $column_width backport problem

1.5.6c $column_width backport problem

Views: 1,624

Results 1 to 2 of 2
17 Sep 2019, 01:45
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,760
Plugin Contributions:
9

1.5.6c $column_width backport problem

Fresh install of 1.5.6c with no products, demo or otherwise. Several mods but none effecting the $column_width variable.

Both includes/modules/column_left.php and includes/modules/colummn_right.php were changed in 1.5.7 and backported to 1.5.6c in an effort to turn the BOX_WIDTH_LEFT and BOX_WIDTH_RIGHT into integers by adding the prefix (int) to each. The rationale was that ZC needed to do math with these settings.

Since math has no idea what PX would be, the change was made. However, css validation requires that ```
Value Error : width only 0 can be a unit. You must put a unit after your number : 150


The Admin  >>  Configuration  >>   Layout Settings suggest that these widths be set to 150px with the note> px maybe included

If px is NOT included, the css will not validate.  Also, removing the (int) prefix to each of the BOX_WIDTH_## validates the css.

I have not had the time to get past this point to see where it may be breaking the math but, did need to get this back into consideration.  I have removed the (int) from both files on this install and will keep an eye out.

It seems that the entire treatment of width and height need to be examined.  The use of px in the image specification for logo.gif violates html as it USES px where it should not.

:frusty:
17 Sep 2019, 15:52
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: 1.5.6c $column_width backport problem

It appears that the (int) was added to the constants so that when includes/templates/YOUR_TEMPLATE/sideboxes/tpl_search.php was accessed the subtraction performed there would not require casting the value to an int. The current version of that file in ZC 1.5.7 adds the unit(s) 'px' after the math. Thus any determined unit entered in the admin is ignored and elsewhere that $column_width is used also ignores the use of a unit.

It seems that an additional variable should be considered that represents the unit(s) as entered in the admin so that they may be used in the template. Regardless it appears that a template would require modification if these three modules include casting the constant to an integer. The generic tpl_search sidebox may have been corrected to not need to cast the value to an integer, but at the "cost" of other template files.

The three module files affected are: column_left.php, column_right.php and column_single.php

These affect the left and right template columns as well as the search sidebox in a default install.