aide prestashop PhenixSuite Help
    • Catégories
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Recherche
    • S'inscrire
    • Se connecter

    Phenix 1.6.X Cannot Print a Deliver Note

    Planifier Épinglé Verrouillé Déplacé Bugs & Améliorations
    4 Messages 3 Publieurs 84 Vues 3 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • B Hors-ligne
      Bitfarmer
      dernière édition par

      I wonder if anyone else has suffered from this bug. Everything else works normally but if you try to print a delivery note for an order, you get a Prestashop Exception always

       #1 ($order_invoice) must be of type OrderInvoice,
       	Order given, called in /var/www/sites/phenix/classes/pdf/PDF.php on line 161 and
       	defined in /var/www/sites/phenix/classes/pdf/HTMLTemplateDeliverySlip.php:43
      
      Stack trace:
       #0 /var/www/sites/phenix/classes/pdf/PDF.php(161): HTMLTemplateDeliverySlipCore->__construct()
       #1 /var/www/sites/phenix/classes/pdf/PDF.php(86): PDFCore->getTemplateObject()
       #2 /var/www/sites/phenix/controllers/admin/AdminPdfController.php(493): PDFCore->render()
       #3 /var/www/sites/phenix/controllers/admin/AdminPdfController.php(451): AdminPdfControllerCore->generatePDF()
       #4 /var/www/sites/phenix/controllers/admin/AdminPdfController.php(109): AdminPdfControllerCore->generateDeliverySlipPDFByIdOrder()
       #5 /var/www/sites/phenix/classes/controller/AdminController.php(1160): AdminPdfControllerCore->processGenerateDeliverySlipPDF()
       #6 /var/www/sites/phenix/controllers/admin/AdminPdfController.php(41): AdminControllerCore->postProcess()
       #7 /var/www/sites/phenix/classes/controller/Controller.php(338): AdminPdfControllerCore->postProcess()
       #8 /var/www/sites/phenix/classes/Dispatcher.php(427): ControllerCore->run()
       #9 /var/www/sites/phenix/storeadmin/index.php(81): DispatcherCore->dispatch()
       #10 {main} thrown in /var/www/sites/phenix/classes/pdf/HTMLTemplateDeliverySlip.php on line 43
      

      I have tried for hours to track this to no avail. Any pointers or help would be greatly appreciated. It is a Type error but if so, how did it ever work! I have been thinking that it must be some change in the database possibly from the data originally coming from OSCommerce, Prestashop, and finally to Phenix Suite, but I can't any changes that alter field definitions in the tables.

      doekiaD 1 réponse Dernière réponse Répondre Citer 0
      • doekiaD Hors-ligne
        doekia @Bitfarmer
        dernière édition par

        @Bitfarmer bugger, once again legacy code bites us. The prototype of the function that was solely an information, gets to be be controlled. The prototype of the function here SHOULD NOT pretend the value is of type x when the code is ready for type x or y. Let's the proto to ignore type.

        Change the proto that says
        public function __construct(OrderInvoice $order_invoice, $smarty, $bulk_mode = false)
        to
        public function __construct($order_invoice, $smarty, $bulk_mode = false)

        Further code will inclus the fix.

        https://store.enter-solutions.com modules, support et assistance.

        Je précise que je n'ai pas fait ni Paco-Rabane, ni Poudlard 2ème langue - je ne suis ni devin, ni magicien.
        Fournissez un maximum d'information dans vos questions, version exacte du coeur et de vos modules, si besoin un peu d'histoire sur votre shop et vos recherches, les modules tiers installés, ...

        Si mon intervention vous a aidé, n'hésitez pas à me remercier: https://ko-fi.com/A153227G

        1 réponse Dernière réponse Répondre Citer 0
        • B Hors-ligne
          Bitfarmer
          dernière édition par

          I am delighted to confirm that the problem is fixed. Thank you very much.

          Maybe it doesn't matter but I did notice the same structure in HTMLTemplateInvoice.php as was in HTMLTemplateDeliverySlip.php

          grep -r '__construct(OrderInvoice $order_invoice'
          
          classes/pdf/HTMLTemplateInvoice.php:    public function __construct(OrderInvoice $order_invoice, $smarty, $bulk_mode = false)
          
          1 réponse Dernière réponse Répondre Citer 0
          • eoliaE Hors-ligne
            eolia
            dernière édition par eolia

            No, the HtmlTemplateInvoice() class always expects an object of type OrderInvoice, so there will never be a problem.

            The HtmlTemplateDeliverySlip() class accepts both types of objects (Order or OrderInvoice). This historical code error only triggered a warning up to PHP 7.2, but beyond that, it's a fatal error.

            Créateur de PhenixSuite. Pour plus d'infos : https://eoliashop.com

            1 réponse Dernière réponse Répondre Citer 0
            • Premier message
              Dernier message
            bug
            26 sujets
            1.6
            24 sujets
            front-office
            11 sujets
            1.5
            8 sujets
            1.7
            5 sujets
            système
            4 sujets
            administration
            3 sujets
            hack
            3 sujets
            module
            3 sujets
            performance
            3 sujets
            smtp
            3 sujets
            transporteurs
            3 sujets
            dashboard
            2 sujets
            https
            2 sujets
            paypal
            2 sujets
            promotions
            2 sujets