0

Long time Tinybutstrong/OpenTBS user here - my application has been moved to a new server (Debian Jessie > Debian Buster), including new versions of Apache (2.4.38) and PHP (7.3 FPM).

$TBS = new \clsTinyButStrong;
$TBS->Plugin( \TBS_INSTALL, \OPENTBS_PLUGIN );
$TBS->LoadTemplate( $doctpl . "#", \OPENTBS_ALREADY_UTF8 );
$TBS->MergeField( "doc", $doc );
$TBS->MergeField( "opts", $opts );
//$TBS->Plugin(\OPENTBS_DEBUG_INFO, \OPENTBS_DEBUG_XML_CURRENT, \OPENTBS_DEBUG_XML_SHOW);
$TBS->Show( \OPENTBS_FILE, $filename );

OpenTBS just returns the template as-is. No merging, no errors in output, no errors in logs. Using the DEBUG plugin, everything seems OK.

OpenTBS clearly has access to the template, otherwise it would not be able to output it. I tried setting permissions to the template to 0666, but that also didn't fix the issue.

Tinybutstrong is at version 3.11.0 - OpenTBS at version 1.9.12.

Any pointers? Thx!

Output of the DEBUG_INFO plugin:

------------------------------
INFORMATION
------------------------------
* Debug command: OPENTBS_DEBUG_INFO
* OpenTBS version: 1.9.12
* TinyButStrong version: 3.11.0
* PHP version: 7.3.19-1~deb10u1YES
* Opened document: /var/www/proius/assets/letterhead/briefErembodegem23.odt
* Activated features for document type: odf/odt

Charts found in the contents: (use command OPENTBS_CHART_INFO to get series's names and data)
-----------------------------
  - (none)
zenlord
  • 330
  • 3
  • 15

1 Answers1

1

Strange thing... I just tried changing a few options, and when I came to the LoadTemplate() method, it started working by just removing the '#' from the command. Changing this:

$TBS->LoadTemplate( $doctpl . "#", \OPENTBS_ALREADY_UTF8 );

into this:

$TBS->LoadTemplate( $doctpl, \OPENTBS_ALREADY_UTF8 );

solved the issue. The optional '#' allegedly forces OpenTBS to not try to detect the file format, so disabling the disabler will maybe increase load on the server, but that's not my primary concern right now...

Hope this helps someone down the road.

zenlord
  • 330
  • 3
  • 15
  • 1
    Tanks for the reply. I have the same behavior with OpenTBS 1.10.0 but I’m surprised that your code worked with a different version of PHP. The '#' is not actually about detecting the format, it is for loading a different main file that the usual one for the format. When adding '#' without explicit sub-file, OpenTBS simply do not load any sub-file at the template loading. That why there were nothing changed. – Skrol29 Jul 15 '20 at 18:19
  • Thank you, @Skrol29. The application used to be hosted on a Debian Jessie server, with PHP 5.6 (mod_php), TBS and OpenTBS were not changed - but I'm not that interested in finding out why it did work back then ;) (but I did face some issues upgrading to a more recent version of TBS/OpenTBS, and maybe this error in my code cause those issues back in the days... – zenlord Jul 15 '20 at 20:18