When no side columns defined in Layout Setting, PHP Warning: Illegal offset type in
Hello to every one, and i hope everyone is safe.
Maybe someone has got the answer.
I am working with Version v1.5.6a) and until i have at least one column everything works just fine
This morning the customer asked for a wider central column , so I defined into the Layour Setting Left and right column as global 0.
Nevertheless the left column continue to be shown.
So i went to the Side Box Setting and put all boxes to off.
Now, no products are shown and the error logo gives the following message:
--> PHP Warning: Illegal offset type in D:\New Webs\DorcasFashion2\includes\modules\responsive_classic\product_listing.php on line 87.
and repeat ti for all 13 products that should be shown in the page.
I went to the php listing but before twitching things I would like to have a second guess on how to sort it out.
Any idea?
Here you can see the working version chez-francesco.fr
Thank you in advance
Claudio
Re: When no side columns defined in Layout Setting, PHP Warning: Illegal offset type
Not sure if it's the whole problem but, you have many HTML errors and a strange setting in one of your stylesheets.
https://validator.w3.org/nu/?doc=htt...5e29e8ba26e1f8 Is the HTML test.
Stylesheet problems are that stylesheet_cu.css reads
Code:
#logo {
float: none;text-align: center;} #pinfo-right-cu{float:left;width:60%;/**
* Main CSS Stylesheet * Claudio modifications * @package templateSystem * @copyright Copyright 2003-2016 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: picaflor-azul Thu Mar 17 12:13:18 2016 -0500 New in v1.5.5 $ */#logo {float: none;text-align: center;} #pinfo-right-cu{float:left;width:60%;padding:0px 0 0 0;
and should be
Code:
#logo {
float: none;text-align: center;} #pinfo-right-cu{float:left;width:60%;padding:0;}
In css, the following are incorrect. 0px, 0em, 0%, etc. Any time a zero is used, it should not have a clarifier. Zero is Zero.
So, your padding would become but that is an error as well. If top-, right-, bottom-, and left-settings are all the same number, there should only be one setting. Therefore, it should be Note the red } in the corrected code. A css line must end in }.
Re: When no side columns defined in Layout Setting, PHP Warning: Illegal offset type
Quote:
Originally Posted by
dbltoe
Not sure if it's the whole problem but, you have many HTML errors and a strange setting in one of your stylesheets.
https://validator.w3.org/nu/?doc=htt...5e29e8ba26e1f8 Is the HTML test.
Stylesheet problems are that stylesheet_cu.css reads
Code:
#logo {
float: none;text-align: center;} #pinfo-right-cu{float:left;width:60%;/**
* Main CSS Stylesheet * Claudio modifications * @package templateSystem * @copyright Copyright 2003-2016 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: picaflor-azul Thu Mar 17 12:13:18 2016 -0500 New in v1.5.5 $ */#logo {float: none;text-align: center;} #pinfo-right-cu{float:left;width:60%;padding:0px 0 0 0;
and should be
Code:
#logo {
float: none;text-align: center;} #pinfo-right-cu{float:left;width:60%;padding:0;}
In css, the following are incorrect. 0px, 0em, 0%, etc. Any time a zero is used, it should not have a clarifier. Zero is Zero.
So, your padding would become
but that is an error as well. If top-, right-, bottom-, and left-settings are all the same number, there should only be one setting. Therefore, it should be
Note the
red } in the corrected code. A css line must end in }.
Thank you very much for your quick answer.
I am going through your comments and let you know.
Have a nice
Claudio
Re: When no side columns defined in Layout Setting, PHP Warning: Illegal offset type
Hi dbltoe, thank you for you clues, i checked and corrected the different mistakes.
By the way there is a warning :
Warning: The type attribute is unnecessary for JavaScript resources.
From line 25, column 1; to line 25, column 31
.css" />↩↩<script type="text/javascript">window
The statement is already in the original code. What do you suggest leave it as it is or correct? In the latter case how ?
As <script></script> ?
Back to the main problem, the error remain, i am going to split the statement in parts to see where the propblem is.
PHP Code:
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' :
'<div><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' .
$productsInCategory[$listing->fields['products_id']] . '&products_id=' . $listing->fields['products_id']) . '">' .
zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a></div>') .
'<div class="descr"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' .
$productsInCategory[$listing->fields['products_id']] . '&products_id=' . $listing->fields['products_id']) . '">' .
substr($listing->fields['products_name'],0,PRODUCT_LIST_DESCRIPTION) . '</a></div><div class="price">' . $products_price . '</div>');
Thank you again for any suggestion.
Claudio
Re: When no side columns defined in Layout Setting, PHP Warning: Illegal offset type
Quote:
Originally Posted by
Claudio_tls
By the way there is a warning :
Warning: The type attribute is unnecessary for JavaScript resources.
From line 25, column 1; to line 25, column 31
.css" />↩↩<script type="text/javascript">window
The statement is already in the original code. What do you suggest leave it as it is or correct? In the latter case how ?
As <script></script> ?
First of all, this is a warning and warnings do not effect the operation of a site.
If a site is fully setup in HTML 5, the type attribute is not needed for the script tag. I imagine all those will be going away in 1.5.8. Meanwhile, it's nothing to worry about.
As to the other warning, It might be that one of your mods has overwritten the proper code for includes\modules\responsive_classic\product_listing.php
You didn't answer that part of the posting tips so, I can only suggest that you compare your current file with one from the original ZC download for your CURRENT version.
Re: When no side columns defined in Layout Setting, PHP Warning: Illegal offset type
Quote:
Originally Posted by
dbltoe
First of all, this is a warning and warnings do not effect the operation of a site.
If a site is fully setup in HTML 5, the type attribute is not needed for the script tag. I imagine all those will be going away in 1.5.8. Meanwhile, it's nothing to worry about.
As to the other warning, It might be that one of your mods has overwritten the proper code for includes\modules\responsive_classic\product_listing.php
You didn't answer that part of the posting tips so, I can only suggest that you compare your current file with one from the original ZC download for your CURRENT version.
Good morning,
Found the bug !!!
PHP Code:
$list_box_contents[$row][$col]
wrong !! :no::no::no:
PHP Code:
$list_box_contents[$rows][$col]
correct :smile::smile::smile:
Thank again in any case for the site checking tool, very useful.
Claudio