VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: John2400 on April 18, 2012, 11:25:43 AM

Title: 2.0.6 Invoice error - In the BE - just clcik on any order invoice Fixed 2.0.7
Post by: John2400 on April 18, 2012, 11:25:43 AM
You can see below my versions,

The invoice in the backend of orders displays the following

just clicking on any order displays  this Warning: array_push() expects parameter 1 to be array, null given in /home/*******/public_html/libraries/tcpdf/tcpdf.php on line 21357

* turns up in a few versions over the past month - was good in 2.0.4
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: TITUS8 on April 20, 2012, 23:38:02 PM
Having this issue aswell, any ideas/fiixes? Iget this when clicking on the invoice view...

Warning: array_push() [function.array-push]: First argument should be an array in /home/***/public_html/libraries/tcpdf/tcpdf.php on line 21357


VM 2.0.6
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: sebnath on April 21, 2012, 10:26:53 AM
Same problem here… Was working fine in 2.0.2, and doesn't work anymore in 2.0.6. Clicking on the invoice icon in the order's list generates the following error message :

Warning: array_push() [function.array-push]: First argument should be an array in .../libraries/tcpdf/tcpdf.php on line 21694

I downloaded again the tcpdf files, and replaced those on my site, but it didn't change anything

I work with J2.5 and VM2.0.6.
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: Milbo on April 22, 2012, 15:38:38 PM
This is imho an error in the layout then.
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: Simon Reynolds on April 22, 2012, 22:38:37 PM
Yes, me too. I upgraded to 2.0.6 today with Joomla 2.5 and get the same. The pdf is not printing but the order is although the image is not showing, just the default No Image image.

I attach the full Invoice text that is produced.


[attachment cleanup by admin]
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: John2400 on April 22, 2012, 23:29:37 PM
Milbo,

If this is an error in the layout - are you tell us to try and fix it or are you saying "you" will fix it?

Not really a big deal for me - as we can always print - but was good for lots of versions -
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: lonokane on April 23, 2012, 01:49:41 AM
I as well receive the error. Joomla 2.5.4 and VM 2.0.6
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: patrik60 on April 23, 2012, 12:38:36 PM
Same problem here.
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: sylwekb on April 23, 2012, 16:16:02 PM

Same problem

prtscr below

[attachment cleanup by admin]
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: mathamatha on April 24, 2012, 11:08:52 AM
Same here
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: jux on April 26, 2012, 17:24:47 PM
same here this is quite weird this is what it shows:

Warning: array_push() expects parameter 1 to be array, null given in /home/............../tcpdf.php on line 21357
%PDF-1.7 %���� 11 0 obj << /Type /Page /Parent 1 0 R /LastModified (D:20120426172357+02'00') /Resources 2 0 R /MediaBox [0.00 0.00 595.28 841.89] /CropBox [0.00 0.00 595.28 841.89] /BleedBox [0.00 0.00 595.28 841.89] /TrimBox [0.00 0.00 595.28 841.89] /ArtBox [0.00 0.00 595.28 841.89] /Contents 12 0 R /Rotate 0 /Group <��-ng�CV\�6��5��U�^��V���2[2�2՞1,���j����…��w�����{v���te���D�U��$����H~��ح��v2�5UA\�@��w�Aʺ�>�65"kE���4��E���W1ޱ;�H$��<<="" type="" xobject="" subtype="" image="" width="" 200="" height="" 41="" smask="" 13="" r="" colorspace="" devicergb="" bitspercomponent="" 8="" filter="" flatedecode="" decodeparms���;��}"��_�%�����͎Z�j�w��m$
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: smartbright on April 27, 2012, 13:18:29 PM
This is how I solved.
1. in libraries\tcpdf open tcpdf.php
2. in LINE 21357 you should see array_push($dom[($dom[$key]['parent'])]['trids'], $key);
replace it with                      
if (is_null($dom[($dom[$key]['parent'])]['trids']))
                             $dom[($dom[$key]['parent'])]['trids'] = array();

3. Try to see it should work.

I get this solution from somewhere (forget already) which I found by google.
Hope this help.

PS. Besure to backup tcpdf.php file.
Title: [SOLVED]Re: 2.0.6 Invoice error - In the back end - just clcik ...order invoice
Post by: TITUS8 on April 27, 2012, 18:03:12 PM
sweet!, thanks, works perfectly.... ;D

21356          // store the TR elements IDs on table element
21357          #array_push($dom[($dom[$key]['parent'])]['trids'], $key);
21358          if (is_null($dom[($dom[$key]['parent'])]['trids']))
21359          $dom[($dom[$key]['parent'])]['trids'] = array();
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: John2400 on April 29, 2012, 12:21:59 PM
?

I was hoping ? I changed the line quite a few times - did not correct for me ?

Did anyone else get this to work?
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: patrik60 on April 29, 2012, 12:31:40 PM
It makes no sense to make core hacking in tcpdf.php.
Just try rev 5964. There are some chages in VM configuration. You may now select on which order status an invoice will be sent. The invoice icon only appears when changing an order status. It can also be set to "none".
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: John2400 on April 29, 2012, 22:53:08 PM
Quote from: patbe60 on April 29, 2012, 12:31:40 PM
Just try rev 5964.

Actually we are not worried about actually sending the invoice - we are in orders in the back and it does not show up simply when we click on it?   could you explain what you mean by rev 5964? reverse, remove, retype?
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: patrik60 on April 29, 2012, 23:07:26 PM
Revision from the svn
Title: Re: 2.0.6 Invoice error - In the back end - just clcik on any order invoice
Post by: lonokane on May 03, 2012, 20:34:46 PM
All, this is fixed in 2.0.7
Title: Re: 2.0.6 Invoice error - In the BE - just clcik on any order invoice Fixed 2.0.7
Post by: jndm on October 11, 2012, 21:17:58 PM
i could solve my problem by setting the cache options to normal caching and 15 minutes in the joomla server configuration
Title: Re: 2.0.6 Invoice error - In the BE - just clcik on any order invoice Fixed 2.0.7
Post by: Uke on January 22, 2014, 01:16:41 AM
I had this problem with Joomla 2.5.17 Virtuemart V2.0.26d. On every first click on delivery note or invoice the pdf was damaged / broken. Second click the pdf opens fine.

Have solved it by editing the /libraries/tcpdf/tcpdf.php on my version the line number was:

Uncoment:

22250      // array_push($dom[($dom[$key]['parent'])]['trids'], $key);

or replaced it with:

22251      if (is_null($dom[($dom[$key]['parent'])]['trids'])){ $dom[($dom[$key]['parent'])]['trids'] = array(); }

Thank you for this monster hack!!! I will do it after every update for sure. And it makes sense for me.