Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default PHP Warning admin/attributes_controller.php

    V1.5.7d
    PHP 7.4
    Just found a php warning in admin/attributes_controller.php. Its just a warning but I have no idea how to fix it.
    count(): Parameter must be an array or an object that implements Countable in admin/attributes_controller.php on line 212
    Line 212 for ($i = 0; $i < count($_POST['values_id']); $i++) {
    PHP Code:
        case 'add_product_attributes':      $current_image_name '';      for ($i 0$i count($_POST['values_id']); $i++) {        if (isset($_POST['values_id'][$i])) {          $value_id = (int)$_POST['values_id'][$i];        }        if (isset($_POST['options_id'])) {          $options_id = (int)$_POST['options_id'];        }        if (isset($_POST['products_id'])) {          $products_id = (int)$_POST['products_id'];        } 
    Thanks

  2. #2
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default Re: PHP Warning admin/attributes_controller.php

    Quote Originally Posted by ianhg View Post
    V1.5.7d
    PHP 7.4
    Just found a php warning in admin/attributes_controller.php. Its just a warning but I have no idea how to fix it.
    count(): Parameter must be an array or an object that implements Countable in admin/attributes_controller.php on line 212
    Line 212 for ($i = 0; $i < count($_POST['values_id']); $i++) {
    PHP Code:
        case 'add_product_attributes':      $current_image_name '';      for ($i 0$i count($_POST['values_id']); $i++) {        if (isset($_POST['values_id'][$i])) {          $value_id = (int)$_POST['values_id'][$i];        }        if (isset($_POST['options_id'])) {          $options_id = (int)$_POST['options_id'];        }        if (isset($_POST['products_id'])) {          $products_id = (int)$_POST['products_id'];        } 
    Thanks
    Sorry to bounce this to the top, but still getting this warning. Can anyone please suggest a fix, many thanks

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,624
    Plugin Contributions
    88

    Default Re: PHP Warning admin/attributes_controller.php

    Quote Originally Posted by ianhg View Post
    Sorry to bounce this to the top, but still getting this warning. Can anyone please suggest a fix, many thanks
    From the current zc158 GitHub, add the highlighted section
    Code:
        case 'add_product_attributes':
          $current_image_name = '';
          if (!isset($_POST['options_id'], $_POST['products_id']) || empty($_POST['values_id'])) {
               break;
          }

  4. #4
    Join Date
    Jul 2007
    Posts
    342
    Plugin Contributions
    7

    Default Re: PHP Warning admin/attributes_controller.php

    Quote Originally Posted by lat9 View Post
    From the current zc158 GitHub, add the highlighted section
    Code:
        case 'add_product_attributes':
          $current_image_name = '';
          if (!isset($_POST['options_id'], $_POST['products_id']) || empty($_POST['values_id'])) {
               break;
          }
    @lat9
    Thank you,

 

 

Similar Threads

  1. Replies: 0
    Last Post: 25 Nov 2013, 02:32 PM
  2. v151 [Duplicate] attributes_controller.php error
    By computel in forum Bug Reports
    Replies: 1
    Last Post: 21 Oct 2012, 02:36 PM
  3. Warning: Division by zero in attributes_controller.php
    By Snicklefritz in forum Setting Up Categories, Products, Attributes
    Replies: 14
    Last Post: 12 May 2010, 04:19 PM
  4. New attributes_controller.php file
    By Bullbreed in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 2 Jun 2009, 02:02 PM

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