FLUX-SE / SyliusEUVatPlugin

This Sylius Plugin allow you to add European VAT Number to the addresses and manage European VAT number rule
MIT License
16 stars 8 forks source link

Error loading fixtures #10

Closed kappaj closed 5 years ago

kappaj commented 5 years ago

I cleaned my database and started to load your fixtures I got this error on the cli:

php bin/console sylius:fixture:load european_vat_zones

Warning! Loading fixtures will purge your database for the dev environment.

Continue? (y/N) y
Running suite "european_vat_zones"...
Running fixture "geographical"...

In GeographicalFixture.php line 189:

  An exception was thrown during loading zone "Rest of the world" with code "REST_OTW"!  

In GeographicalFixture.php line 256:

  Could not find country "TA", defined ones are: AF, EG, AX, AL, DZ, AS, VI, UM, AD, AO, AI, AQ, AG, GQ, AR, AM, AW, AZ, ET, AU, BS, BH, BD, B  
  B, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, VG, IO, BN, BG, BF, BI, CV, CL, CN, CK, CR, CI, CW, DK, DE, DM, DO, DJ, EC, SV, ER, EE, F  
  K, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, GH, GI, GD, GR, GL, GP, GU, GT, GG, GN, GW, GY, HT, HM, HN, IN, ID, IQ, IR, IE, IS, IM, IL, IT, J  
  M, JP, YE, JE, JO, KY, KH, CM, CA, KZ, QA, KE, KG, KI, CC, CO, KM, CG, CD, HR, CU, KW, LA, LS, LV, LB, LR, LY, LI, LT, LU, MG, MW, MY, MV, M  
  L, MT, MA, MH, MQ, MR, MU, YT, MX, FM, MC, MN, ME, MS, MZ, MM, NA, NR, NP, NC, NZ, NI, NL, NE, NG, NU, KP, MP, MK, NF, NO, OM, AT, PK, PS, P  
  W, PA, PG, PY, PE, PH, PN, PL, PT, PR, MD, RE, RW, RO, RU, SB, ZM, WS, SM, ST, SA, SE, CH, SN, RS, SC, SL, ZW, SG, SX, SK, SI, SO, HK, MO, E  
  S, SJ, LK, BL, SH, KN, LC, MF, PM, VC, ZA, SD, GS, KR, SS, SR, SZ, SY, TJ, TW, TZ, TH, TL, TG, TK, TO, TT, TD, CZ, TN, TR, TM, TC, TV, UG, U  
  A, HU, UY, UZ, VU, VA, VE, AE, US, GB, VN, WF, CX, EH, CF, CY!                                                                                
 

My "fast fix" was the removing of the missing countries in fixtures.yaml. The missing countries were:

AC
IC
EA
DG
XK
XA
XB
TA

But I don't know if this is the best solution.

Prometee commented 5 years ago

I also encounter it during the update of Symfony 4.3 because this countries have been remove. I forget to delete them from this plugin fixtures...

Can you make a pull request removing it ?

Also I think a fixture load test is maybe required here to avoid future problems.

kappaj commented 5 years ago

I found another thing but maybe I don't understand it exactly: After loading the fixtures I have 249 countries but 247 zone_members. So 2 countries are not mapped to zones? Is this OK?

Prometee commented 5 years ago

Let me check the complete list into symfony/intl

Prometee commented 5 years ago

So getting the list from : https://github.com/symfony/intl/blob/master/Resources/data/regions/fr.json Removing all European countries, here is the complete REST_OTW list :

                                    - "AD"
                                    - "AE"
                                    - "AF"
                                    - "AG"
                                    - "AI"
                                    - "AL"
                                    - "AM"
                                    - "AO"
                                    - "AQ"
                                    - "AR"
                                    - "AS"
                                    - "AU"
                                    - "AW"
                                    - "AX"
                                    - "AZ"
                                    - "BA"
                                    - "BB"
                                    - "BD"
                                    - "BF"
                                    - "BH"
                                    - "BI"
                                    - "BJ"
                                    - "BL"
                                    - "BM"
                                    - "BN"
                                    - "BO"
                                    - "BQ"
                                    - "BR"
                                    - "BS"
                                    - "BT"
                                    - "BV"
                                    - "BW"
                                    - "BY"
                                    - "BZ"
                                    - "CA"
                                    - "CC"
                                    - "CD"
                                    - "CF"
                                    - "CG"
                                    - "CH"
                                    - "CI"
                                    - "CK"
                                    - "CL"
                                    - "CM"
                                    - "CN"
                                    - "CO"
                                    - "CR"
                                    - "CU"
                                    - "CV"
                                    - "CW"
                                    - "CX"
                                    - "DJ"
                                    - "DM"
                                    - "DO"
                                    - "DZ"
                                    - "EC"
                                    - "EG"
                                    - "EH"
                                    - "ER"
                                    - "ET"
                                    - "FJ"
                                    - "FK"
                                    - "FM"
                                    - "FO"
                                    - "GA"
                                    - "GB"
                                    - "GD"
                                    - "GE"
                                    - "GF"
                                    - "GG"
                                    - "GH"
                                    - "GI"
                                    - "GL"
                                    - "GM"
                                    - "GN"
                                    - "GP"
                                    - "GQ"
                                    - "GS"
                                    - "GT"
                                    - "GU"
                                    - "GW"
                                    - "GY"
                                    - "HK"
                                    - "HM"
                                    - "HN"
                                    - "HT"
                                    - "ID"
                                    - "IL"
                                    - "IM"
                                    - "IN"
                                    - "IO"
                                    - "IQ"
                                    - "IR"
                                    - "IS"
                                    - "JE"
                                    - "JM"
                                    - "JO"
                                    - "JP"
                                    - "KE"
                                    - "KG"
                                    - "KH"
                                    - "KI"
                                    - "KM"
                                    - "KN"
                                    - "KP"
                                    - "KR"
                                    - "KW"
                                    - "KY"
                                    - "KZ"
                                    - "LA"
                                    - "LB"
                                    - "LC"
                                    - "LI"
                                    - "LK"
                                    - "LR"
                                    - "LS"
                                    - "LY"
                                    - "MA"
                                    - "MC"
                                    - "MD"
                                    - "ME"
                                    - "MF"
                                    - "MG"
                                    - "MH"
                                    - "MK"
                                    - "ML"
                                    - "MM"
                                    - "MN"
                                    - "MO"
                                    - "MP"
                                    - "MQ"
                                    - "MR"
                                    - "MS"
                                    - "MU"
                                    - "MV"
                                    - "MW"
                                    - "MX"
                                    - "MY"
                                    - "MZ"
                                    - "NA"
                                    - "NC"
                                    - "NE"
                                    - "NF"
                                    - "NG"
                                    - "NI"
                                    - "NO"
                                    - "NP"
                                    - "NR"
                                    - "NU"
                                    - "NZ"
                                    - "OM"
                                    - "PA"
                                    - "PE"
                                    - "PF"
                                    - "PG"
                                    - "PH"
                                    - "PK"
                                    - "PM"
                                    - "PN"
                                    - "PR"
                                    - "PS"
                                    - "PW"
                                    - "PY"
                                    - "QA"
                                    - "RE"
                                    - "RS"
                                    - "RU"
                                    - "RW"
                                    - "SA"
                                    - "SB"
                                    - "SC"
                                    - "SD"
                                    - "SG"
                                    - "SH"
                                    - "SJ"
                                    - "SL"
                                    - "SM"
                                    - "SN"
                                    - "SO"
                                    - "SR"
                                    - "SS"
                                    - "ST"
                                    - "SV"
                                    - "SX"
                                    - "SY"
                                    - "SZ"
                                    - "TC"
                                    - "TD"
                                    - "TF"
                                    - "TG"
                                    - "TH"
                                    - "TJ"
                                    - "TK"
                                    - "TL"
                                    - "TM"
                                    - "TN"
                                    - "TO"
                                    - "TR"
                                    - "TT"
                                    - "TV"
                                    - "TW"
                                    - "TZ"
                                    - "UA"
                                    - "UG"
                                    - "UM"
                                    - "US"
                                    - "UY"
                                    - "UZ"
                                    - "VA"
                                    - "VC"
                                    - "VE"
                                    - "VG"
                                    - "VI"
                                    - "VN"
                                    - "VU"
                                    - "WF"
                                    - "WS"
                                    - "YE"
                                    - "YT"
                                    - "ZA"
                                    - "ZM"
                                    - "ZW"
Prometee commented 5 years ago

I just create a new release to fix this