osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> [ABANDON]Warning: array_merge(): Argument #1 is not an array in \catalog\admin\customers.php
roiphoto
posté 24 Jan 2017, 18:56
Message #1


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Warning: array_merge(): Argument #1 is not an array in \catalog\admin\customers.php on line 743

WINDOWS 8 PRO ; 32 bits
EasyPHP-12.1
Version PHP 5.4.6
osCommerce Online Merchant v2.2 RC1 W3C Valid FR
+ Contribution CAP 1.4.3 (Customer Add Product)
En local

Bonjour,
Mon projet fonctionne 5/5 en local quand je suis en PHP 4.3.10 (easyPHP-1.cool.gif.
Rien à dire sur ce point

Par contre, le même projet en PHP 5.4.6 (esayPHP-12.1) et toujours avec la même version oscommerce 2.2 ci-dessus citée, j’obtiens les 4 warnings suivants, tous dans
Outil administration /box_customers_customers

Warning: array_merge(): Argument #1 is not an array in C:\Program Files\EasyPHP-12.1\www\catalog\admin\customers.php on line 743
Warning: array_merge(): Argument #2 is not an array in C:\Program Files\EasyPHP-12.1\www\catalog\admin\customers.php on line 745



Warning: reset() expects parameter 1 to be array, null given in C:\Program Files\EasyPHP-12.1\www\catalog\admin\includes\classes\object_info.php on line 17
Warning: Variable passed to each() is not an array or object in C:\Program Files\EasyPHP-12.1\www\catalog\admin\includes\classes\object_info.php on line 18

Voici le fichier catalog\admin\includes\classes\object_info.php
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright © 2003 osCommerce
Released under the GNU General Public License
*/

class objectInfo {
// class constructor
Ligne 16 function objectInfo($object_array) {
ligne 17 reset($object_array);
ligne 18 while (list($key, $value) = each($object_array)) {
ligne 19 $this->$key = tep_db_prepare_input($value);
}
}
}
?>

J’ai corrigé toutes les fonctions obsolètes, cannot modify header, les < ? que j’ai remplacé par < ?PHP et pourtant les warnings sont toujours présents.
Est-ce qu’il existe une autre manière de changer de version de PHP ?
Je vous remercie

Ce message a été modifié par roiphoto - 20 Mar 2018, 18:07.
Go to the top of the page
 
Bonbec
posté 25 Jan 2017, 00:06
Message #2


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Bonsoir,

Toutes les erreurs découlent de la première :
Warning: array_merge(): Argument #1 is not an array in C:\Program Files\EasyPHP-12.1\www\catalog\admin\customers.php on line 743

A priori la variable $country n'est pas un array alors qu'elle est sensée l'être.
Il y a de fortes chances pour que la variable $customers['entry_country_id'] du $country_query ne contienne rien.

Si le fichier $customers.php est rigoureusement identique entre les 2 projets, les tables customers, adress_book etc ... ont-elles bien été transférées ?


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
roiphoto
posté 14 Feb 2017, 17:55
Message #3


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Bonjour Bonbec ,
Merci pour l’aide
OSCOMMERCE 2.2 RC1
EN LOCAL
Je rappelle que le site fonctionne très bien en local en php4.3.10.

Mon hébergeur américain me dit qu’avec cette version de php(4.3.10), l’hébergement ne peut être qu’en VPS server, alors que j’aurais aimé être en mutualisé
J’ai recommencé le projet en transposant tous les fichiers systématiquement de php 4.3.10 vers php 5.4.6

J’ai corrigé tous les < ? en < ?php
Toutes les fonctions obsolètes sont corrigées en me servant du post
https://github.com/osCommerce/oscommerce2/c...def4f2c9f94b0b7

Tous les liens fonctionnent bien en php 5.4.6 sauf que
en local quand je veux insérer le produit, je remplis tout ce qui est à remplir et je clique sur la prévisualisation et direct il m’envoie à la page index du site alors qu’avec php 4.3.10 la prévisualisation et l’insertion du produit se passent très bien

Ma question !
en php5.4.6 Pourquoi me refoule-t-il en m’envoyant me balader à l’accueil.
Je me permets de vous envoyer le fichier complet catalog/account_add.php
Code
<?php
/*
  $Id: account_add.php,v 1.4 2005/05/16 23:03:52 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');
  require(DIR_WS_FUNCTIONS.'/product_manage.php');
  require(DIR_WS_CLASSES.'/product_manage.php');
  require(DIR_WS_CLASSES . 'upload.php');

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }
  $customer_query = tep_db_query("select customers_firstname,customers_lastname,customers_email_address,customers_ap from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
  $customer = tep_db_fetch_array($customer_query);

  

  require(DIR_WS_LANGUAGES . $language . '/account_add.php');

  $action = (isset($_REQUEST['action']) ? $_REQUEST['action'] : '');
  $osCsid = (isset($_REQUEST['osCsid']) ? $_REQUEST['osCsid'] : '');
   switch ($action) {
   case 'new_product_preview':
         // copy image only if modified
        //echo DIR_WS_IMAGES;
        //print_r ($customer);
        //die($products_image);
        $products_image = new upload('products_image');
        $products_image->set_destination(DIR_WS_IMAGES);
        if ($products_image->parse() && $products_image->save()) {
          $products_image_name = $products_image->filename;
        } else {
          $products_image_name = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : '');
        }

        if ($products_image_swf){

                            /*  echo $products_image_swf;
                              $products_image_swf = new upload('products_image_swf');
                              $products_image_swf->set_destination(DIR_WS_IMAGES);
                              if ($products_image_swf->parse() && $products_image_swf->save()) {
                                $products_image_name2 = $products_image_swf->filename;
                              } else {
                                $products_image_name2 = (isset($_POST['products_previous_image']) ? $_POST['products_previous_image'] : '');
                              }*/

        }
        //die($products_image_name);
        break;

   case 'insert_product':
   case 'update_product':
        if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) {
          $action = 'new_product';
        } else {
          if (isset($_GET['pID'])) $products_id = tep_db_prepare_input($_GET['pID']);
          $products_date_available = tep_db_prepare_input($_POST['products_date_available']);

          $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';

          $sql_data_array = array('products_quantity' => tep_db_prepare_input($_POST['products_quantity']),
                                  'products_model' => tep_db_prepare_input($_POST['products_model']),
                                  'products_price' => tep_db_prepare_input($_POST['products_price']),
                                  'products_date_available' => $products_date_available,
                                  'products_weight' => tep_db_prepare_input($_POST['products_weight']),
                                  'products_status' => '0',//tep_db_prepare_input($_POST['products_status']),
                                  'products_tax_class_id' => tep_db_prepare_input($_POST['products_tax_class_id']),
                                  'customer_id' => $customer_id,
                                  'manufacturers_id' => tep_db_prepare_input($_POST['manufacturers_id']));

          if (isset($_POST['products_image']) && tep_not_null($_POST['products_image']) && ($_POST['products_image'] != 'none')) {
            $sql_data_array['products_image'] = tep_db_prepare_input($_POST['products_image']);
          }

          if ($action == 'insert_product') {
            $insert_sql_data = array('products_date_added' => 'now()');

            $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

            tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
            $products_id = tep_db_insert_id();

            tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$category_id . "')");
          } elseif ($action == 'update_product') {
            $update_sql_data = array('products_last_modified' => 'now()');

            $sql_data_array = array_merge($sql_data_array, $update_sql_data);

            tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
          }

          $languages = tep_get_languages();
          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
            $language_id = $languages[$i]['id'];

            $sql_data_array = array('products_name' => tep_db_prepare_input($_POST['products_name'][$language_id]),
                                    'products_description' => tep_db_prepare_input($_POST['products_description'][$language_id]),
                                    'products_url' => tep_db_prepare_input($_POST['products_url'][$language_id]));

            if ($action == 'insert_product') {
              $insert_sql_data = array('products_id' => $products_id,
                                       'language_id' => $language_id);

              $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

              tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
            } elseif ($action == 'update_product') {
              tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
            }
          }

          if (USE_CACHE == 'true') {
            tep_reset_cache_block('categories');
            tep_reset_cache_block('also_purchased');
          }
          define(EMAIL_TEXT_SUBJECT,'Un nouveau produit a été ajouté');
          $category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id ."'");
          $category = tep_db_fetch_array($category_query);

          $email =  "Cher administrateur\n\n";
          $email .= "Un nouveau produit a été ajouté dans la catégorie : ".$category['categories_name']."\n\n";
          $email .= "Cet ajout a été fait par : ". $customer['customers_firstname'].' '.$customer['customers_lastname'] ."\n\n";
          $email .= "Pour approuver ce nouveau produit, veuillez vous rendre dans votre panneau d\'administration \n\n";
          tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT, $email,$customer['customers_firstname'].' '.$customer['customers_lastname'],$customer['customers_email_address']);
          tep_redirect(tep_href_link(FILENAME_DEFAULT, 'osCsid=' . $osCsid . '&pID=' . $products_id));
        }
        break;
   }
  $breadcrumb->add('My Account', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
  $breadcrumb->add('Add new product', tep_href_link('account_add.php', '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript" src="includes/admin_general.js"></script>
<link id="luna-tab-style-sheet" type="text/css" rel="stylesheet" href="includes/javascript/tabs/tabpane.css" />
<script type="text/javascript" src="includes/javascript/tabs/tabpane.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<div id="spiffycalendar" class="text" style="z-index:3"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
    </table></td>
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
      </tr>
      <tr>
        <td>

<?php
  if ($action != 'new_product_preview') {
    $parameters = array('products_name' => '',
                       'products_description' => '',
                       'products_url' => '',
                       'products_id' => '',
                       'products_quantity' => '',
                       'products_model' => '',
                       'products_image' => '',
                       'products_price' => '',
                       'products_weight' => '',
                       'products_date_added' => '',
                       'products_last_modified' => '',
                       'products_date_available' => '',
                       'products_status' => '',
                       'products_tax_class_id' => '',
                       'category_id' => '',
                       'manufacturers_id' => '');

    $pInfo = new objectInfo($parameters);

    if (isset($_GET['pID']) && empty($_POST)) {
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
      $product = tep_db_fetch_array($product_query);

      $pInfo->objectInfo($product);
    } elseif (tep_not_null($_POST)) {
      $pInfo->objectInfo($_POST);
      $products_name = $_POST['products_name'];
      $products_description = $_POST['products_description'];
      $products_url = $_POST['products_url'];
    }

    $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
      $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
                                     'text' => $manufacturers['manufacturers_name']);
    }
    $languages = tep_get_languages();
    //print_r( $languages);
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
    //echo $languages[$i]['directory'];
    if ($languages[$i]['directory']==$language) $language_id=$languages[$i]['id'];
    }
    $categories_array = array(array('id' => '', 'text' => TEXT_NONE));
    $categories_query = tep_db_query("select a.categories_id,parent_id, b.categories_name from " . TABLE_CATEGORIES . " as a," . TABLE_CATEGORIES_DESCRIPTION . " as b where a.categories_id = b.categories_id and b.language_id = " . (int)$language_id . " order by categories_id");
    while ($categories = tep_db_fetch_array($categories_query)) {
      //echo  $categories['parent_id'];
      $parent_id = $categories['parent_id'];
      if ($parent_id==0)
      {
              $categories_array[] = array('id' => $categories['categories_id'],
                                     'text' => $categories['categories_name']);
                                     } else {
                                            $txt=NULL;
                                            while ($parent_id!=0) {
                                             //echo $parent_id;
                                             $category_query = tep_db_query("select a.categories_id,parent_id, b.categories_name from " . TABLE_CATEGORIES . " as a," . TABLE_CATEGORIES_DESCRIPTION . " as b where a.categories_id = b.categories_id and a.categories_id = " . $parent_id . " and b.language_id = " . (int)$language_id . " order by categories_id");
                                             $category  =  tep_db_fetch_array($category_query);
                                              $txt .=$category['categories_name']."->";
                                              $parent_id = $category['parent_id'];
                                              //die($txt.$parent_id.$category['categories_id']);
                                              }
                                             $categories_array[] = array('id' => $categories['categories_id'],
                                                                   'text' => $txt.$categories['categories_name']);
                                             }
    }

    $tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
    $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
    while ($tax_class = tep_db_fetch_array($tax_class_query)) {
      $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
                                 'text' => $tax_class['tax_class_title']);
    }


    if (!isset($pInfo->products_status)) $pInfo->products_status = '1';
    switch ($pInfo->products_status) {
      case '0': $in_status = false; $out_status = true; break;
      case '1':
      default: $in_status = true; $out_status = false;
    }
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<script language="javascript"><!--
  var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
//--></script>
<script language="javascript"><!--
var tax_rates = new Array();
<?php
    for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {
      if ($tax_class_array[$i]['id'] > 0) {
        echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";
      }
    }
?>

function doRound(x, places) {
  return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}

function getTaxRate() {
  var selected_value = document.forms["new_product"].products_tax_class_id.selectedIndex;
  var parameterVal = document.forms["new_product"].products_tax_class_id[selected_value].value;

  if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
    return tax_rates[parameterVal];
  } else {
    return 0;
  }
}

function updateGross() {
  var taxRate = getTaxRate();
  var grossValue = document.forms["new_product"].products_price.value;

  if (taxRate > 0) {
    grossValue = grossValue * ((taxRate / 100) + 1);
  }

  document.forms["new_product"].products_price_gross.value = doRound(grossValue, 4);
}

function updateNet() {
  var taxRate = getTaxRate();
  var netValue = document.forms["new_product"].products_price_gross.value;

  if (taxRate > 0) {
    netValue = netValue / ((taxRate / 100) + 1);
  }

  document.forms["new_product"].products_price.value = doRound(netValue, 4);
}
//--></script>
<?php echo tep_draw_form('new_product', 'account_add.php?osCsid=' . $osCsid . (isset($_REQUEST['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo TEXT_NEW_PRODUCT; ?></td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
        </table></td>
      </tr>
<table width="100%" border="0">
  <tr>
    <td valign="middle" align="left">

  <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>

<div class="tab-page" id="configPane"><script type="text/javascript">
   var tabPane1 = new WebFXTabPane( document.getElementById( "configPane" ), 0 )
</script>
<div class="tab-page" id="site-page"><h2 class="tab"><?php echo TEXT_HEADING_TAB1; ?></h2><script type="text/javascript">
  tabPane1.addTabPage( document.getElementById( "site-page" ) );</script> <table class="adminform">
<td><table>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_radio_field('products_status', '1', $in_status) . '&nbsp;' . TEXT_PRODUCT_AVAILABLE . '&nbsp;' . tep_draw_radio_field('products_status', '0', $out_status) . '&nbsp;' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>
            </tr>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br><small>(JJ-MM-AAAA)</small></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'; ?><script language="javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="dd-MM-yyyy";</script></td>
            </tr>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_CATEGORY; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('category_id', $categories_array, $pInfo->categories_id); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>
            </tr>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
<?php
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
            <tr bgcolor="#ebebff">
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>
            <td class="main"><?php echo tep_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>
            </tr>
<?php
    }
?>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onKeyUp="updateGross()"'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'OnKeyUp="updateNet()"'); ?></td>
            </tr>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
<script language="javascript">
<!--
updateGross();
//-->
</script>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>
            </tr>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_model', $pInfo->products_model); ?></td>
            </tr>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_IMAGE; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_file_field('products_image','') . tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . $pInfo->products_image . tep_draw_hidden_field('products_previous_image', $pInfo->products_image); ?></td>
            <tr>
            <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
            </tr>
            <tr bgcolor="#ebebff">
            <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>
            </tr>
   </table></td></table>
        </div>

<div class="tab-page" id="Locale-page"><h2 class="tab"><?php echo TEXT_HEADING_TAB2; ?></h2>
<script type="text/javascript"> tabPane1.addTabPage( document.getElementById( "Locale-page" ) );</script>
   <table class="adminform">
    <?php
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
            <tr bgcolor="#ebebff">
            <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
            <td width="100%"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td class="main" valign="top"><?php echo tep_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
                <td class="main" width="100%"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '20', '10', (isset($products_description[$languages[$i]['id']]) ? $products_description[$languages[$i]['id']] : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
              </tr>
            </table></td>
          </tr>
<?php
    }
?>
    </table>
        </div>


<div class="tab-page" id="Locale2-page"><h2 class="tab"><?php echo TEXT_HEADING_TAB3; ?></h2>
<script type="text/javascript"> tabPane1.addTabPage( document.getElementById( "Locale2-page" ) );</script>
<table class="adminform">
<td><table>
   <?php
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
            <tr bgcolor="#ebebff">
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_URL . '<br><small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?></td>
            <td class="main"><?php echo tep_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (isset($products_url[$languages[$i]['id']]) ? $products_url[$languages[$i]['id']] : tep_get_products_url($pInfo->products_id, $languages[$i]['id']))); ?></td>
            </tr>
<?php
    }
?>

     </td></table>
    </table>
        </div>
        
<div align="center" class="tab-page" id="about-page"><h2 class="tab"><?php echo TEXT_HEADING_TAB4; ?></h2>
<script type="text/javascript">  tabPane1.addTabPage( document.getElementById( "about-page" ) );</script>
  <table class="adminform">
    <td width="100%" valign="top" align="center"><table border="0" width="100%" cellspacing="0" cellpadding="2" align="center">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td class="pageHeading" align="center"><? echo TEXT_TITLE_TAB4; ?></td>
            <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
          </tr>
           </tr>
          <tr>
           <td class="main" align="center" valign="top"><? echo TEXT_TAB4; ?><br></td>
           </tr>
           <tr>
           <td class="main" align="center" valign="top"><br></td>
           </tr>
                <tr>
                    <td align=center valign=top><img src="images/logo.png">
                    </td>
           <tr><td align=center valign=top><font class=small color=#FFA500><a href='http://www.procreator.info' color=#FFA500 target=_blank><font color=#FFA500>www.procreator.info</a></font></td>
            </tr>
            </table></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    </div>
</div>
<?php
}
if ($action == 'new_product_preview') {
    if (tep_not_null($_POST)) {
      $pInfo = new objectInfo($_POST);
      $products_name = $_POST['products_name'];
      $products_description = $_POST['products_description'];
      $products_url = $_POST['products_url'];
    } else {
      $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$_GET['pID'] . "'");
      $product = tep_db_fetch_array($product_query);

      $pInfo = new objectInfo($product);
      $products_image_name = $pInfo->products_image;
    }

    $form_action = (isset($_GET['pID'])) ? 'update_product' : 'insert_product';

    echo tep_draw_form($form_action, 'account_add.php?osCsid=' . $osCsid . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');

    $languages = tep_get_languages();
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
      if (isset($_GET['read']) && ($_GET['read'] == 'only')) {
        $pInfo->products_name = tep_get_products_name($pInfo->products_id, $languages[$i]['id']);
        $pInfo->products_description = tep_get_products_description($pInfo->products_id, $languages[$i]['id']);
        $pInfo->products_url = tep_get_products_url($pInfo->products_id, $languages[$i]['id']);
      } else {
        $pInfo->products_name = tep_db_prepare_input($products_name[$languages[$i]['id']]);
        $pInfo->products_description = tep_db_prepare_input($products_description[$languages[$i]['id']]);
        $pInfo->products_url = tep_db_prepare_input($products_url[$languages[$i]['id']]);
      }
?>
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading"><?php echo tep_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $pInfo->products_name; ?></td>
            <td class="pageHeading" align="right"><?php echo $currencies->format($pInfo->products_price); ?></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="main"><?php echo tep_image(DIR_WS_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description; ?></td>
      </tr>

<?php


      if ($pInfo->products_url) {
?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
      <tr>
        <td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>
      </tr>
<?php
      }
?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
<?php
      if ($pInfo->products_date_available > date('Y-m-d')) {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_AVAILABLE, tep_date_long($pInfo->products_date_available)); ?></td>
      </tr>
<?php
      } else {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_PRODUCT_DATE_ADDED, tep_date_long($pInfo->products_date_added)); ?></td>
      </tr>
<?php
      }
?>
      <tr>
        <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
      </tr>
<?php
    }

    if (isset($_GET['read']) && ($_GET['read'] == 'only')) {
      if (isset($_GET['origin'])) {
        $pos_params = strpos($_GET['origin'], '?', 0);
        if ($pos_params != false) {
          $back_url = substr($_GET['origin'], 0, $pos_params);
          $back_url_params = substr($_GET['origin'], $pos_params + 1);
        } else {
          $back_url = $_GET['origin'];
          $back_url_params = '';
        }
      } else {
        $back_url = FILENAME_MANAGE;
        $back_url_params = 'osCsid=' . $osCsid . '&pID=' . $pInfo->products_id;
      }
?>
      <tr>
        <td align="right"><?php echo '<a href="' . tep_href_link($back_url, $back_url_params, 'NONSSL') . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
      </tr>
<?php
    } else {
?>
      <tr>
        <td align="right" class="smallText">
<?php
/* Re-Post all POST'ed variables */
      reset($_POST);
      while (list($key, $value) = each($_POST)) {
        if (!is_array($_POST[$key])) {
          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
        }
      }
      $languages = tep_get_languages();
      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
        echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
        echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
      }
      echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));

      echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '&nbsp;&nbsp;';

      if (isset($_GET['pID'])) {
        echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
      } else {
        echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
      }
      echo '&nbsp;&nbsp;<a href="' . tep_href_link('account.php', 'osCsid=' . $osCsid . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
?></td>
      </tr>
    </table></form>
<?php
    }
  }
  ?>

<?php if ($action != 'new_product_preview') {
    ?>  <tr>
        <td class="main" align="right"><?php echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW) . '&nbsp;&nbsp;<a href="' . tep_href_link('account_add.php', 'osCsid=' . $osCsid . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
      </tr>
    </table></form>
      <?php }?>
<!-- body_text_eof //-->
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
    </table></td>
  </tr>
</table>
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


Merci pour votre aide
Go to the top of the page
 
Bonbec
posté 14 Feb 2017, 18:32
Message #4


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Bonjour,
Si j'ai bien compris ce message du fil du support officiel de cet addon, le fait de revenir à la page index serait dû à un osCsid manquant.
La modif indiquée étant déjà appliquée dans le code, ma question : l'osCsid a-t-il une valeur ligne 30 ( $osCsid = (isset($_REQUEST['osCsid']) ? $_REQUEST['osCsid'] : ''); ) ?


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
Bonbec
posté 18 Feb 2017, 11:56
Message #5


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Pas de réponse pour la valeur de $osCsid ?


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
roiphoto
posté 14 Mar 2017, 17:22
Message #6


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Bonjour,

Merci bonbec pour votre réponse.

Excuse-moi pour le retard pour retour d’info. Je ne savais qu’il y avait un forum américain qui traitait de cet addon. Je n’y ai rien trouvé d’intéressant.

Je ne sais pas de quel numéro vous parlez en disant de osCsid .Sinon après la ligne d'osCsid il n'y de nombre !

Avec php 4.3.10 (easyphp 1.cool.gif ; mon_site tourne très, très bien (images bien téléchargées, textes, les boutons rouge et vert, etc), ce qui me poussera vers un hébergement VPS

Voilà ce qui est écrit dans la barre d’adresse du navigateur avec easyphp 1.8 quand je clique sur le bouton prévisualiser http://127.0.0.1/mon_site/account_add.php?...product_preview. Et tout se passe très bien. Je ne sais pas si j’ai répondu à votre question

Par contre easyphp12.1 (php 5.4.6 quand je clique sur prévisualisation), retour direct à l’index, sans aucun message.

Pour les erreurs array_merge j’ai fait une réinstallation d’oscommerce et de la contribution avec la tête bien reposée et c’est bon

Je vous remercie
Go to the top of the page
 
Bonbec
posté 14 Mar 2017, 17:36
Message #7


Ceinture marron OSC
Icône de groupe

Groupe : Modérateurs
Messages : 1543
Inscrit : 30-May 06
Lieu : Vichy (03)
Membre no 10583



Bonjour,

je parlais de la ligne 30 du fichier catalog/account_add.php :
Code
require(DIR_WS_LANGUAGES . $language . '/account_add.php');

  $action = (isset($_REQUEST['action']) ? $_REQUEST['action'] : '');
  $osCsid = (isset($_REQUEST['osCsid']) ? $_REQUEST['osCsid'] : ''); // <<<<<========== c'est celle-ci
   switch ($action) {


Ajoutez echo devantet un exit juste après, comme ceci :
Code
echo $osCsid = (isset($_REQUEST['osCsid']) ? $_REQUEST['osCsid'] : '');
exit;

et regardez dans la page si cela affiche une valeur à cet osCsid.
Si oui, alors l'erreur est ailleurs.
Si non, il faudra trouver pourquoi le script ne récupère pas la valeur de l'osCid.


--------------------
Config 1 en live : Osc 2.2 très fortement modifié ... UTF-8 et Php 5.4.
Contribs installées : down_for_maintenance_v 2.3 | Estimated Shipping v1.5 | imprint_1_3_5 | low_stock_report_v2.04 | visible_countries_1.2b | Products Tabs | shoppingCart_cleanup_v1.01.0 | + trop de bidouilles persos pas très OsCommerce (erreurs de jeunesse)
Config 2 en local avec UwAmp : Osc Phoenix
Go to the top of the page
 
roiphoto
posté 15 Mar 2017, 12:31
Message #8


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Bonjour,
Merci Bonbec pour votre réponse.

Excuse-moi pour le retard pour retour d’info. Je ne savais qu’il y avait un forum américain qui traitait de cet addon. Je n’y ai rien trouvé d’intéressant.

Je ne sais pas de quel numéro vous parlez en disant de osCsid

Avec php 4.3.10 (easyphp 1.cool.gif ; mon_site tourne très, très bien (images bien téléchargées, textes, les boutons rouge et vert, etc), ce qui me poussera vers un hébergement VPS

Voilà ce qui est écrit dans la barre d’adresse du navigateur avec easyphp 1.8 quand je clique sur le bouton prévisualiser http://127.0.0.1/mon_site/account_add.php?...product_preview. Et tout se passe très bien. Je ne sais pas si j’ai répondu à votre question

Par contre easyphp12.1 (php 5.4.6 quand je clique sur prévisualisation), retour direct à l’index, sans aucun message.

Pour les erreurs array_merge j’ai fait une réinstallation d’oscommerce et de la contribution avec la tête bien reposée et c’est bon

Je vous remercie
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 28th March 2024 - 23:41
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)