Jump to content

Fatal error (Address -> dni is empty) After Truncate test clients


Recommended Posts

I hope someone can help, it´s happened to me twice Version 13.2 and now 13.4 After Truncating Data Base to delete test information I now get a fatal error when creating a account in home page "Fatal error (Address -> dni is empty)" when in fact this field is filled out and produces this error.

Then it also seems that the old information of clients e-mails and DNI numbers is still there somewhere as it does mention that it has been used before. so I am not sure if this maybe causing a problem !!

*I have also noticed that when you refresh browser that the new page comes up ;1. someone has already registered with this e-mail address, 2. this DNI has been already used. I have noticed that the CITY Drop down field goes missing one the error is created.

I have read many of the post, and my conclusion is that it´s a data base problem as all was working perfect before doing the TRUNCATE, but not sure how to fix it so any help would be truly appreciated.

Link to comment
Share on other sites

Just for some hints, here is one example that caused Fatal Error.

My client truncated following tables in order to clear all test accounts

ps_customer
ps_address

Then, when sign a new account, the fatal error happened.

Why?

Because the table ps_customer_group is still there not truncated.
When a new account is signed up, system trying to add customer group to table ps_customer_group new new account id and group, for example , but the the same is already in database, and a fatal error is reported.

I guess you may have similar scenario(if not the same)

hope this give you some hints

Link to comment
Share on other sites

for the issue of my example, just truncate the ps_customer_group will fix the problem.
I don't know what is your case. I suggest don't truncate table, instead use delete command (SQL).

truncate will restart the identify ID,
delete will not restart the identity ID, so usually there is not problem.

Link to comment
Share on other sites

HI Shokinro we have tried to delete but get the same error, also notice that the ID´s starts from last number entered so from 1 till 12 must be there somewhere and we can´t find them when we search DB it´s like the data is cashed somewhere !!

The website is www.putomatica.com you are welcome to create a account to see the error, I now have a lovely website but can´t receive customers Grrrr

Link to comment
Share on other sites

Hello. I had the same error, the solution was to set fields dni in ps_addresses for all addresses and also change "classes/Validate php" (functions isDniLite and isDni) in order to proper validate our "dni" number format.

Link to comment
Share on other sites

Hello Cieszak, thank you for your reply, could you please give instruction as I get what you are saying but not shore how to implement it. This is the second time and I am starting to build 1.4 but would like my live site working correctly.

Link to comment
Share on other sites

first change dni in database (i set all dni field to '-'):

UPDATE ps_addresses SET dni='-'


but probably you will need only to fill empty fields, so first try:

UPDATE ps_addresses SET dni='-' WHERE dni IS NULL


and then the second step, it it is not working try the first SQL command above

second, change classes/Validate.php
you have here functions:

   static public function isDniLite($dni)
   {
       return empty($dni) OR (bool)preg_match('/^[0-9a-z-.]{1,16}$/Ui', $dni);
   }

   static public function isDni($dni)
   {

       /*
       Return code:
       1 : It's Ok
       0 : Bad format for DNI
       -1 : DNI duplicate
       -2 : NIF error
       -3 : CIF error
       -4 : NIE error
       */

       Tools::displayAsDeprecated();

       if (!$dni)
           return 1;

(...)

       return 0;
   }



you can simply change it to:

    
static public function isDniLite($dni)
{
       return true;
}

static public function isDni($dni)
{
       return 1;
}




but now there will be no validation for this field

Link to comment
Share on other sites

×
×
  • Create New...