I got a weird bug today and it seems that you can't use 2 times (or more) the same table with the same data in a document.
Screenshots below use the following data:
$first_event = [
"first_date" => "22/06/2018",
"last_date" => "22/06/2018"
];
$second_event = [
"first_date" => "22/06/2018",
"last_date" => "22/06/2018"
];
$data = [$first_event,$second_event];
$TBS->MergeBlock('event', $data);
Original Document (3 PAGES, 2 TABLES)
Rendered Document (2 PAGES, 1 TABLE)
What I expected here is to have 2 tables containing 2 rows on the first two pages. (1 table per page, second table would be green)
But what I get is this :
Bug is really easy to reproduce, you can try by copying any of your table and pasting it on the same document. If it does use the same "block" variable, then the tables will get mixed up together and magic will happen.
Btw it does the same thing with rows using same data.
Also, I'm using latest version of TBS.
Thanks for reading this, hoping I'll get good advices.
This is not a bug. Two blocks having the same name are considered as the same block with several sections. So any content between the sections is deleted.
In order to merged several blocks with the same data, you have to use several names in the template and merged then with one MerkeBlock()
$data = [$first_event,$second_event];
$TBS->MergeBlock('event1,event2', $data);