If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Windows Server / Category Name and Categories Description now show on backend?

Category Name and Categories Description now show on backend?

Started by holawill on 11 Nov 2016, 8:10 AM · Views: 8,823

Results 1 to 11 of 11
11 Nov 2016, 8:10 AM
#1
holawill avatar

holawill

New Zenner

Join Date:
Jul 2016
Posts:
35
Plugin Contributions:
0

Category Name and Categories Description now show on backend?

my site works well online, but when i move to localhost, the Category Name and Categories Description now show on backend,
Attachment 16781
on frontend i can see Category Name and Categories Description without any problems.

besides, for product name and description are the same situation.

my zencart version: v1.5.1
wampserver3.0.6_x86_apache2.4.23_mysql5.7.14_php5.6.25-7.0.10

i checked logs error:
[11-Nov-2016 07:46:46 UTC] PHP Warning: Invalid argument supplied for foreach() in D:\wamp\www\pinbadge\adminn\includes\ckeditor.php on line 15
[11-Nov-2016 07:46:46 UTC] PHP Stack trace:
[11-Nov-2016 07:46:46 UTC] PHP 1. {main}() D:\wamp\www\pinbadge\adminn\categories.php:0
[11-Nov-2016 07:46:46 UTC] PHP 2. include() D:\wamp\www\pinbadge\adminn\categories.php:559

how to solve my problem? thanks in advance.

11 Nov 2016, 12:11 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Category Name and Categories Description now show on backend?

My response relates to the PHP version/ZC version aspect that may play a factor as relates to the posted server requirements: http://www.zen-cart.com/content.php?48-what-are-the-server-requirements-to-run-zen-cart

Otherwise things such as an incomplete database transfer/restoration may be involved, method of transfer, database problems, etc.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

11 Nov 2016, 3:33 PM
#3
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Category Name and Categories Description now show on backend?

just a guess; i would think your languages table has no data...

prior to clicking on the edit category, you could also change the editor to plain text.

good luck.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

12 Nov 2016, 5:36 AM
#4
holawill avatar

holawill

New Zenner

Join Date:
Jul 2016
Posts:
35
Plugin Contributions:
0

Re: Category Name and Categories Description now show on backend?

i can make sure database complete transfer. The same database i tested on live server it works well.

So Zen Cart v1.5.1 is not compatible with PHP 5.6.25? this is the problem?

12 Nov 2016, 5:40 AM
#5
holawill avatar

holawill

New Zenner

Join Date:
Jul 2016
Posts:
35
Plugin Contributions:
0

Re: Category Name and Categories Description now show on backend?

carlwhat:

just a guess; i would think your languages table has no data...

prior to clicking on the edit category, you could also change the editor to plain text.

good luck.

Thanks. languages table has data, see below pic:
Attachment 16785

I also tested plain text editor before clicking on the edit category, still the same:(

12 Nov 2016, 6:17 AM
#6
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Category Name and Categories Description now show on backend?

#1 - i don't think this is a compatibility issue.
#2 - have you posted the complete debug log? i don't think the script should stop on a warning. please post the complete contents of the debug log.
#3 - post the contents on the ckeditor.php file.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

12 Nov 2016, 9:55 AM
#7
holawill avatar

holawill

New Zenner

Join Date:
Jul 2016
Posts:
35
Plugin Contributions:
0

Re: Category Name and Categories Description now show on backend?

carlwhat:

#1 - i don't think this is a compatibility issue.
#2 - have you posted the complete debug log? i don't think the script should stop on a warning. please post the complete contents of the debug log.
#3 - post the contents on the ckeditor.php file.

#2, yes, i have posted the completed debug log, i checked again. by the way, when i select plain text, there's no error log, once i selected CKEditor, the error caused.
#3 ```php

<?php /** * @package admin * @copyright Copyright 2010 Kuroi Web Design * @copyright Portions Copyright 2009 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: ckeditor.php 277 2010-05-22 14:09:32Z kuroi $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $var = zen_get_languages(); $jsLanguageLookupArray = "var lang = new Array;\n"; foreach ($var as $key) { $jsLanguageLookupArray .= " lang[" . $key['id'] . "] = '" . $key['code'] . "';\n"; } ?> <script type="text/javascript" src="<?php echo (strstr(HTTP_SERVER, 'ttps:') ? 'https' : 'http'); ?>://www.google.com/jsapi"></script> <script type="text/javascript">if (typeof jQuery == 'undefined') google.load("jquery", "1");</script> <script type="text/javascript" src="../<?php echo DIR_WS_EDITORS ?>ckeditor/ckeditor.js"></script> <script type="text/javascript"><!-- $(document).ready(function() { <?php echo $jsLanguageLookupArray ?> $('textarea').each(function() { if ($(this).attr('name') != 'message' && $(this).attr('class') != 'noEditor') { index = $(this).attr('name').match(/\d+/); if (index == null) index = <?php echo $_SESSION['languages_id'] ?>; CKEDITOR.replace($(this).attr('name'), { coreStyles_underline : { element : 'u' }, width : 760, language: lang[index] }); } }); }); //--></script>
12 Nov 2016, 4:26 PM
#8
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Category Name and Categories Description now show on backend?

the error message is complaining about line 15:

foreach ($var as $key)

in general, this problem is because $var is not an array.

$var gets established 2 lines above, in zen_get_languages. which is why i would think there is nothing in the languages table.

we can add the following line just above the foreach line to see what is in $var and post the results:

print_r($var);

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

7 Dec 2016, 9:52 AM
#9
holawill avatar

holawill

New Zenner

Join Date:
Jul 2016
Posts:
35
Plugin Contributions:
0

Re: Category Name and Categories Description now show on backend?

carlwhat:

the error message is complaining about line 15:

foreach ($var as $key)

in general, this problem is because $var is not an array.

$var gets established 2 lines above, in zen_get_languages. which is why i would think there is nothing in the languages table.

we can add the following line just above the foreach line to see what is in $var and post the results:

print_r($var);

I have added this line above the foreach line, but error logs are the same as before, no other errors.

<?php
/**
 * @package admin
 * @copyright Copyright 2010 Kuroi Web Design
 * @copyright Portions Copyright 2009 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: ckeditor.php 277 2010-05-22 14:09:32Z kuroi $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

$var = zen_get_languages();
$jsLanguageLookupArray = "var lang = new Array;\n";
print_r($var);
foreach ($var as $key)
{
  $jsLanguageLookupArray .= "  lang[" . $key['id'] . "] = '" . $key['code'] . "';\n";
}
?>
<script type="text/javascript" src="<?php echo (strstr(HTTP_SERVER, 'ttps:') ? 'https' : 'http'); ?>://www.google.com/jsapi"></script>
<script type="text/javascript">if (typeof jQuery == 'undefined') google.load("jquery", "1");</script>
<script type="text/javascript" src="../<?php echo DIR_WS_EDITORS ?>ckeditor/ckeditor.js"></script>
<script type="text/javascript"><!--
$(document).ready(function() {
  <?php echo $jsLanguageLookupArray ?>
  $('textarea').each(function()	{
    if ($(this).attr('name') != 'message' && $(this).attr('class') != 'noEditor')
    {
      index = $(this).attr('name').match(/\d+/);
      if (index == null) index = <?php echo $_SESSION['languages_id'] ?>;
      CKEDITOR.replace($(this).attr('name'),
        {
          coreStyles_underline : { element : 'u' },
          width : 760,
          language: lang[index]
        });
    }
  });
});
//--></script>

can can i do now?

7 Dec 2016, 9:53 AM
#10
holawill avatar

holawill

New Zenner

Join Date:
Jul 2016
Posts:
35
Plugin Contributions:
0

Re: Category Name and Categories Description now show on backend?

carlwhat:

the error message is complaining about line 15:
foreach ($var as $key)
in general, this problem is because $var is not an array.
$var gets established 2 lines above, in zen_get_languages. which is why i would think there is nothing in the languages table.
we can add the following line just above the foreach line to see what is in $var and post the results:
print_r($var);


Thanks, I have added this line above the foreach line, but error logs are the same as before, no other errors.

<?php
/**
 * @package admin
 * @copyright Copyright 2010 Kuroi Web Design
 * @copyright Portions Copyright 2009 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: ckeditor.php 277 2010-05-22 14:09:32Z kuroi $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

$var = zen_get_languages();
$jsLanguageLookupArray = "var lang = new Array;\n";
print_r($var);
foreach ($var as $key)
{
  $jsLanguageLookupArray .= "  lang[" . $key['id'] . "] = '" . $key['code'] . "';\n";
}
?>
<script type="text/javascript" src="<?php echo (strstr(HTTP_SERVER, 'ttps:') ? 'https' : 'http'); ?>://www.google.com/jsapi"></script>
<script type="text/javascript">if (typeof jQuery == 'undefined') google.load("jquery", "1");</script>
<script type="text/javascript" src="../<?php echo DIR_WS_EDITORS ?>ckeditor/ckeditor.js"></script>
<script type="text/javascript"><!--
$(document).ready(function() {
  <?php echo $jsLanguageLookupArray ?>
  $('textarea').each(function()	{
    if ($(this).attr('name') != 'message' && $(this).attr('class') != 'noEditor')
    {
      index = $(this).attr('name').match(/\d+/);
      if (index == null) index = <?php echo $_SESSION['languages_id'] ?>;
      CKEDITOR.replace($(this).attr('name'),
        {
          coreStyles_underline : { element : 'u' },
          width : 760,
          language: lang[index]
        });
    }
  });
});
//--></script>

Can you please tell me what can i do now?

9 Dec 2016, 3:20 PM
#11
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,974
Plugin Contributions:
8

Re: Category Name and Categories Description now show on backend?

holawill,
i would not expect the errors to change.

can you show a new screen shot of the page where the error occurs?

the print_r statement should show the value of $var variable; which calls the function zen_get_languages. for some reason that function does not seem to be populating the variable. to ensure you are at the right spot you can add this line right after the print_r statement:

die(FILE . ':' . LINE);

once you do that, go back to the category page, and take a screenshot and post it here.

this is what my page looks like and i would expect something similar:

Array ( [0] => Array ( [id] => 1 [name] => English [code] => en [image] => icon.gif [directory] => english ) ) /var/www/ADMINN/includes/ckeditor.php:18

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.