Categories > [old] TbsOoo & TinyDoc >

tinyDoc nested array bug?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: nathangray
Date: 2009-05-20
Time: 21:32

tinyDoc nested array bug?

Given an array:
[0] => array(
stock_id => 123
CAD => array(
  cost => 0.70
)
USD => array(
  cost => 1.20
)
)
[1] => ...
)

and another:
currency1 = array(
[0] => array(currency_id => USD)
[1] => array(currency_id => CAD)
)
and a spreadsheet template, with this as the cell:
[stock.[currency1.currency_id;block=table:table-cell].cost;type=currency]

Merge currency1 first, to give two cells:
[stock.USD.cost;type=currency]
[stock.CAD.cost;type=currency]

Then merge stock.  Expected:
1.20
0.70

Actual is blank cells.  This did work with tbsOOo. 

I suspect a bug on line 990, the data is not properly set through the SubLst.
This change makes it work:
-      $data = isset($Value[$sub]) ? $Value[$sub] : null ;
+      $data = isset($data[$sub]) ? $data[$sub] : null ;

Is this a good change?
By: Olivier Loynet
Date: 2009-05-20
Time: 23:16

Re: tinyDoc nested array bug?

I've see it. I've not deepening into it.
I think it's a problem of tinyButStrong 3.4 with PHP5

I will make a report to Skrol

Olivier
By: Olivier Loynet
Date: 2009-06-24
Time: 18:26

Re: tinyDoc nested array bug?

I've read too quickly.
I'll test your submit and release in the next version

Olivier