Jump to content
passio

1.7 -> Onglet "Facture" - Erreur critique

Recommended Posts

Bonsoir, voilà que j'ai passé la journée à migrer de 1.6 vers 1.7... J'ai corrigé beaucoup de problèmes mais il ne reste que celui-ci pour que tout soit parfait. Lorsque je vais dans "Commande->Facture", j'ai l'erreur suivante, possiblement parce qu'il y aurait eu dans ma vie des erreurs où la facture n'aurait pas été généré ? Mais comment savoir où, dans des milliers de commandes... et encore, c'est qu'une supposition.

 

Symfony\Component\Form\Exception\UnexpectedTypeException

PropertyPathMapper->mapDataToForms('', object(RecursiveIteratorIterator))in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php (line 379)
 
PropertyPathMapper->mapDataToForms(array('enable_invoices' => true, 'enable_tax_breakdown' => false, 'enable_product_images' => true, 'invoice_prefix' => array('#FA', false, false), 'add_current_year' => false, 'reset_number_annually' => false, 'year_position' => 0, 'invoice_number' => 0, 'legal_free_text' => '', 'footer_text' => array('Numéro SIREN : XXXXXXXX', false, false), 'invoice_model' => 'invoice', 'use_disk_cache' => false), object(RecursiveIteratorIterator))in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php (line 379)
 
Form->setData(array('enable_invoices' => true, 'enable_tax_breakdown' => false, 'enable_product_images' => true, 'invoice_prefix' => array('#FA', false,false), 'add_current_year' => false, 'reset_number_annually' => false, 'year_position' => 0, 'invoice_number' => 0, 'legal_free_text' => '', 'footer_text' =>array('Numéro SIREN : XXXXX', false, false), 'invoice_model' => 'invoice', 'use_disk_cache' => false))in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php (line 49)
 
PropertyPathMapper->mapDataToForms(array('invoice_options' => array('enable_invoices' => true, 'enable_tax_breakdown' => false, 'enable_product_images' => true, 'invoice_prefix' => array('#FA', false, false), 'add_current_year' => false, 'reset_number_annually' => false, 'year_position' => 0, 'invoice_number' => 0, 'legal_free_text' => '', 'footer_text' => array('Numéro SIREN : XXXXXXXXX', false, false), 'invoice_model' => 'invoice', 'use_disk_cache' => false)),object(RecursiveIteratorIterator))in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php (line 379)
 
Form->setData(array('invoice_options' => array('enable_invoices' => true, 'enable_tax_breakdown' => false, 'enable_product_images' => true, 'invoice_prefix' => array('#FA', false, false), 'add_current_year' => false, 'reset_number_annually' => false, 'year_position' => 0, 'invoice_number' => 0, 'legal_free_text' => '', 'footer_text' => array('Numéro SIREN : XXXXX', false, false), 'invoice_model' => 'invoice', 'use_disk_cache' => false)))in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php (line 483)
 
FormBuilder->getForm()in src/Core/Form/FormHandler.php (line 114)
  1.             [
  2.                 'form_builder' => &$this->formBuilder,
  3.             ]
  4.         );
  5.  
  6.         return $this->formBuilder->getForm();
  7.     }
  8.  
  9.     /**
  10.      * {@inheritdoc}
  11.      *
InvoicesController->indexAction(object(Request))in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)
HttpKernel->handleRaw(object(Request), 1)in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)
HttpKernel->handle(object(Request), 1, false)in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php (line 200)
Kernel->handle(object(Request), 1, false)in admin8281swqcf/index.php (line 88)


Avec les informations suivantes dans LOGS :

 
Level Channel Message
DEBUG19:55:16 doctrine SELECT name FROM ps_module WHERE active = 1
INFO19:55:16 request Matched route "admin_order_invoices".
DEBUG19:55:16 security Read existing security token from the session.
DEBUG19:55:16 security User was reloaded from a user provider.
DEBUG19:55:17 doctrine SELECT name FROM ps_module WHERE active = 1
DEBUG19:55:17 doctrine SELECT COUNT(o.id_order) AS nbOrders, o.current_state as id_order_state FROM `ps_order_invoice` oi LEFT JOIN `ps_orders` o ON oi.id_order = o.id_order WHERE o.id_shop IN(:shopIds) AND oi.number > 0 GROUP BY o.current_state
INFO19:55:17 php User Deprecated: Implementing "Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "Csa\Bundle\GuzzleBundle\DataCollector\GuzzleCollector".
CRITICAL19:55:17 php Uncaught Exception: Expected argument of type "object, array or empty", "string" given
CRITICAL19:55:17 request Uncaught PHP Exception Symfony\Component\Form\Exception\UnexpectedTypeException: "Expected argument of type "object, array or empty", "string" given" at /Applications/MAMP/htdocs/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php line 41


Uncaught Exception: Expected argument of type "object, array or empty", "string" given, *

ça veut dire qu'on passe un argument de type non attendu.... Mais où ? Et comment régler ca... Je sais qu'il y a eu dans le passé des bug au moment de la validation de la commande et que les factures n'étaient pas générée. 

Share this post


Link to post
Share on other sites

J'ai finalement trouvé la solution... 

SIMPLE SOLUTION TO TEST AND FIX THIS ERROR

  1. Take a look into ps_configuration_lang to check how many languages you have enabled and their corresponding id's:
    SELECT * FROM ps_configuration_lang

  2. Run this SQL on the database:
    SELECT * FROM ps_configuration_lang WHERE id_configuration = (select id_configuration FROM ps_configuration WHERE name = "PS_INVOICE_PREFIX");
    SELECT * FROM ps_configuration_lang WHERE id_configuration = (select id_configuration FROM ps_configuration WHERE name = "PS_INVOICE_LEGAL_FREE_TEXT");
    SELECT * FROM ps_configuration_lang WHERE id_configuration = (select id_configuration FROM ps_configuration WHERE name = "PS_INVOICE_FREE_TEXT");

You should have an equal number of rows with the number of each enabled language for each of the three queries. This is how the result looks like for a shop with 5 enabled languages.
If any of the query returns empty or misses rows for some languages, then you will need to add the missing rows:

  1. FIXING
    To fix missing PS_INVOICE_PREFIX:
    INSERT INTO ps_configuration_lang (id_configuration, id_lang, value, date_upd) values ((select id_configuration FROM ps_configuration WHERE name = "PS_INVOICE_PREFIX"), 1, "#IN", NOW());

(replace 1 with each of your language ids (id_lang)

To fix missing PS_INVOICE_LEGAL_FREE_TEXT:
INSERT INTO ps_configuration_lang (id_configuration, id_lang, value, date_upd) values ((select id_configuration FROM ps_configuration WHERE name = "PS_INVOICE_LEGAL_FREE_TEXT"), 1, "TEXT", NOW());

(replace 1 with each of your language ids (id_lang)

To fix missing PS_INVOICE_FREE_TEXT:
INSERT INTO ps_configuration_lang (id_configuration, id_lang, value, date_upd) values ((select id_configuration FROM ps_configuration WHERE name = "PS_INVOICE_FREE_TEXT"), 1, "TEXT", NOW());

(replace 1 with each of your language ids (id_lang)

Share this post


Link to post
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

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More