Jump to content

error vid ändring av adress för kund


Recommended Posts

Någon som vet vart man skall felsöka och ändra för att få detta att funka ...

 

PS 1.6.1.4 

Problem : Felkod när kund skall ändra leverans adress ifrån sitt konto. 



Code genereated by debugg mode TRUE : 
 

[PrestaShopException]

Property Address->company is empty
at line 909 in file classes/ObjectModel.php

904. }
905.
906. $message = $this->validateField($field, $this->$field);
907. if ($message !== true) {
908. if ($die) {
909. throw new PrestaShopException($message);
910. }
911. return $error_return ? $message : false;
912. }
913. }
914.
  • ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php]
    241. * @return array All object fields
    242. * @throws PrestaShopException
    243. */
    244. public function getFields()
    245. {
    246. $this->validateFields();
    247. $fields = $this->formatFields(self::FORMAT_COMMON);
    248.
    249. // For retro compatibility
    250. if (Shop::isTableAssociated($this->def['table'])) {
    251. $fields = array_merge($fields, $this->getFieldsShop());
  • ObjectModelCore->getFields - [line 652 - classes/ObjectModel.php]
    647.
    648. if (Shop::checkIdShopDefault($this->def['table']) && !$this->id_shop_default) {
    649. $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list);
    650. }
    651. // Database update
    652. if (!$result = Db::getInstance()->update($this->def['table'], $this->getFields(), '`'.pSQL($this->def['primary']).'` = '.(int)$this->id, 0, $null_values)) {
    653. return false;
    654. }
    655.
    656. // Database insertion for multishop fields related to the object
    657. if (Shop::isTableAssociated($this->def['table'])) {
  • ObjectModelCore->update - [line 195 - classes/Address.php] - [1 Arguments]
    190.
    191. if (Validate::isUnsignedId($this->id_customer)) {
    192. Customer::resetAddressCache($this->id_customer, $this->id);
    193. }
    194.
    195. return parent::update($null_values);
    196. }
    197.
    198. /**
    199. * @see ObjectModel::delete()
    200. */
    Argument [0]
     
  • AddressCore->update - [line 211 - classes/Address.php]
    206.
    207. if (!$this->isUsed()) {
    208. return parent::delete();
    209. } else {
    210. $this->deleted = true;
    211. return $this->update();
    212. }
    213. }
    214.
    215. /**
    216. * Returns fields required for an address in an array hash
  • AddressCore->delete - [line 192 - controllers/front/AddressController.php]
    187. $address->id_state = 0;
    188. }
    189. $address_old = $this->_address;
    190. if (Customer::customerHasAddress($this->context->customer->id, (int)$address_old->id)) {
    191. if ($address_old->isUsed()) {
    192. $address_old->delete();
    193. } else {
    194. $address->id = (int)$address_old->id;
    195. $address->date_add = $address_old->date_add;
    196. }
    197. }
  • AddressControllerCore->processSubmitAddress - [line 107 - controllers/front/AddressController.php]
    102. * @see FrontController::postProcess()
    103. */
    104. public function postProcess()
    105. {
    106. if (Tools::isSubmit('submitAddress')) {
    107. $this->processSubmitAddress();
    108. } elseif (!Validate::isLoadedObject($this->_address) && Validate::isLoadedObject($this->context->customer)) {
    109. $_POST['firstname'] = $this->context->customer->firstname;
    110. $_POST['lastname'] = $this->context->customer->lastname;
    111. $_POST['company'] = $this->context->customer->company;
    112. }
  • AddressControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
    173. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
    174. $this->setMedia();
    175. }
    176.
    177. // postProcess handles ajaxProcess
    178. $this->postProcess();
    179.
    180. if (!empty($this->redirect_after)) {
    181. $this->redirect();
    182. }
    183.
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
    362. if (isset($params_hook_action_dispatcher)) {
    363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
    364. }
    365.
    366. // Running controller
    367. $controller->run();
    368. } catch (PrestaShopException $e) {
    369. $e->displayMessage();
    370. }
    371. }
    372.
  • DispatcherCore->dispatch - [line 28 - index.php]
    23. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
    24. * International Registered Trademark & Property of PrestaShop SA
    25. */
    26.
    27. require(dirname(__FILE__).'/config/config.inc.php');
    28. Dispatcher::getInstance()->dispatch();
Edited by Sponsor365 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...