Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Transaction Patterns » Error running output2 pattern
Error running output2 pattern [message #4287] Tue, 24 June 2014 11:47 Go to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
Hi,

the following error message comes up when running an output2 pattern:

2014-06-24 17:34:15
Fatal Error: Some data has already been output, can't send PDF file (# 256)
Error in line 559 of file '/var/www/vhosts/mgh-saar.de/includes/std.pdf.class.inc'.
PHP_SELF: /htmanager/htm/htm_db_kontakte(output2).php
CURRENT DIRECTORY: /var/www/vhosts/mgh-saar.de/htm/htmanager/htm
SERVER_ADDR: 217.91.254.197
SERVER_NAME: www.htmanager.de
HTTP_HOST: www.htmanager.de
User Id: TVN
Role Id: GLOBAL
REMOTE_ADDR: 217.91.254.197
REQUEST_URI: /htmanager/htm/htm_db_kontakte(output2).php?session_name=men u0

Page Stack:

[0] main_menu
[1] htm
[2] htm_db_kontakte(list1)
[3] htm_db_kontakte(output2)

Backtrace:
0: array =
function: string = errorHandler
args: array =
0: integer = 256
1: string = Some data has already been output, can't send PDF file
2: string = /var/www/vhosts/mgh-saar.de/includes/std.pdf.class.inc
3: integer = 559
4: array =
msg: string = Some data has already been output, can't send PDF file
1: array =
file: string = /var/www/vhosts/mgh-saar.de/includes/std.pdf.class.inc
line: integer = 559
function: string = trigger_error
args: array =
0: string = Some data has already been output, can't send PDF file
1: integer = 256
2: array =
file: string = /var/www/vhosts/mgh-saar.de/includes/tcpdf/tcpdf_php5.php
line: integer = 7586
function: string = Error
class: string = PDF
type: string = ->
args: array =
0: string = Some data has already been output, can't send PDF file
3: array =
file: string = /var/www/vhosts/mgh-saar.de/includes/std.pdf.class.inc
line: integer = 1679
function: string = Output
class: string = TCPDF
type: string = ->
args: array =
0: string = htm_db_kontakte.pdf
1: string = I
4: array =
file: string = /var/www/vhosts/mgh-saar.de/includes/std.output2.inc
line: integer = 92
function: string = outputPDF_ListView
class: string = PDF
type: string = ->
args: array =
5: array =
file: string = /var/www/vhosts/mgh-saar.de/htm/htmanager/htm/htm_db_kontakt e(output2).php
line: integer = 18
args: array =
0: string = /var/www/vhosts/mgh-saar.de/includes/std.output2.inc
function: string = require

Changing destination from 'I' to 'D' brings up the same error.
What did I wrong?
Re: Error running output2 pattern [message #4324 is a reply to message #4287] Sun, 06 July 2014 04:38 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
None of my OUTPUT2 tasks fail in this way, so there must be something wrong in your code. This type of error is caused by something being output, which could be a single blank line, before the script tries to produce its own output. I suggest you take a look at your scripts to see if there are any blank lines either before the opening "<?php" or after the closing "?>".

Re: Error running output2 pattern [message #4339 is a reply to message #4324] Fri, 11 July 2014 10:10 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
Sorry for replying once more but I checked the scripts if there are blank lines before or after the php-tag but there aren't.
I also checked if I can open the list views of the framework. I can open them.
I deleted an recreated the output-tasks. The same result.
I created all the possible output-tasks (1 to 5). Everything works fine but the list view and the label view.
I also checked the table schema with relations etc. with no success.
I removed the column 'rdcaccount_id' and the relation to the mnu_account table. The same result.
I traced the code to the function output($name, $dest) in the file tcpdf_php5.php where the error is probably(?) generated. But I am not familiar enough to see what is going wrong.
What else could be wrong? Do I have to take care of certain table restrictions or something like that? I attached the file kontakte.dict.inc.

[Updated on: Fri, 11 July 2014 10:12]

Report message to a moderator

Re: Error running output2 pattern [message #4340 is a reply to message #4339] Fri, 11 July 2014 11:52 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
There is no attachment, so I cannot examine your script.

Blank lines before or after the PHP tags are just one way of causing this error. Another would be to have an echo statement somewhere which writes to the output stream.

I do not have this error with any of the OUTPUT2 tasks that I have generated, so it is not caused by my code. You need to examine your scripts very carefully to see where it is writing to the output stream.


Re: Error running output2 pattern [message #4341 is a reply to message #4340] Sat, 12 July 2014 02:18 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
All the code is automatically generated by the Frameword, that's why I don't understand that it doesn't work.

Here is the code of the task script: htm_kontakte(output2).php:

<?php
//********************************************************** *******************
// Extract the contents of a database table and export them to a PDF file which
// will be downloaded to the client device.
//********************************************************** *******************

$table_id = 'kontakte'; // table name
$report = 'kontakte.list.report.inc'; // file identifying report structure

// customise the SQL SELECT statement
$sql_select = null;
$sql_from = null;
$sql_where = null;
$sql_groupby = null;
$sql_having = null;
$sql_orderby = null;

require 'std.output2.inc'; // activate page controller

?>

Here is the code of the class file:

<?php
// ************************************************************ *****************
// Copyright 2003-2005 by A J Marston <http://www.tonymarston.net>
// Copyright 2006-2012 by Radicore Software Limited <http://www.radicore.org>
// ************************************************************ *****************
require_once 'std.table.class.inc';
class kontakte extends Default_Table
{
// ************************************************************ ****************
function kontakte ()
{
// save directory name of current script
$this->dirname = dirname(__file__);

$this->dbms_engine = ''; // to be supplied by getFieldSpec_original()
$this->dbprefix = ''; // to be supplied by getFieldSpec_original()
$this->dbname = 'htm';
$this->tablename = 'kontakte';

// call this method to get original field specifications
// (note that they may be modified at runtime)
$this->fieldspec = $this->getFieldSpec_original();

} // kontakte

function _cm_getInitialData ($fieldarray)
// Perform custom processing for the getInitialData method.
// $fieldarray contains data from the initial $where clause.
{
// $_SESSION['logon_user_id'] = $logon_user_id;
// $_SESSION['logon_user_name'] = $fieldarray['user_name'];
// $_SESSION['role_id'] = $fieldarray['role_id'];
// $_SESSION['logon_email_addr'] = $fieldarray['email_addr'];
// $_SESSION['rdcaccount_id'] = $fieldarray['rdcaccount_id'];

if (!empty($_SESSION['logon_user_id'])) {
// get next available number for user_seq_no
$where = "user_id='{$_SESSION['logon_user_id']}'";
$query = "SELECT max(user_seq_no) FROM $this->tablename WHERE $where";
$count = $this->getCount($query);
$fieldarray['user_id'] = $_SESSION['logon_user_id'];
$fieldarray['user_seq_no'] = $count + 1;
} // if

// set these fields to 'noedit' (read only)
$this->fieldspec['user_id']['noedit'] = 'y';
$this->fieldspec['user_seq_no']['noedit'] = 'y';

return $fieldarray;

} // _cm_getInitialData

function _cm_getExtraData ($where, $fieldarray)
// Perform custom processing for the getExtraData method.
// $where = a string in SQL 'where' format.
// $fieldarray = the contents of $where as an array.
{
// get values for kontakt_typ_id and insert into lookup array
$array = $this->getValRep('kontakt_typ_id');
$this->lookup_data['kontakt_typ_id'] = $array;

// get values for kontakt_position_id and insert into lookup array
$array = $this->getValRep('kontakt_position_id'); // Feld in Tabelle kontakte
$this->lookup_data['kontakt_position_id'] = $array; // s.o.

// get contents of foreign table KONTAKTE_TYP and add to lookup array
$dbobject =& RDCsingleton::getInstance('kontakte_typ');
$array = $dbobject->getValRep('kontakt_typ_id_list');
$this->lookup_data['kontakt_typ_id_list'] = $array;

// get contents of foreign table KONTAKTE_POSITION and add to lookup array
$dbobject =& RDCsingleton::getInstance('kontakte_position'); // Lookup-Tabelle
$array = $dbobject->getValRep('kontakt_position_id'); // Lookup-Tabellen-Feld
$this->lookup_data['kontakt_position_id'] = $array;

return $fieldarray;

} // _cm_getExtraData

// ************************************************************ ****************
} // end class
// ************************************************************ **************** <?php
// file created on July 11, 2014, 3:31 pm

// field specifications for table htm.kontakte
$fieldspec['user_id'] = array('type' => 'string',
'size' => 16,
'pkey' => 'y',
'required' => 'y',
'uppercase' => 'y');

$fieldspec['user_seq_no'] = array('type' => 'integer',
'type_native' => 'int',
'size' => 11,
'minvalue' => 0,
'maxvalue' => 4294967295,
'pkey' => 'y',
'required' => 'y');

$fieldspec['rdcaccount_id'] = array('type' => 'integer',
'type_native' => 'int',
'size' => 10,
'minvalue' => 0,
'maxvalue' => 4294967295,
'required' => 'y',
'default' => '1');

$fieldspec['kontakt_typ_id'] = array('type' => 'string',
'size' => 6,
'required' => 'y',
'default' => 'SP',
'uppercase' => 'y',
'control' => 'dropdown',
'optionlist' => 'kontakt_typ_id_list');

$fieldspec['node_id'] = array('type' => 'integer',
'type_native' => 'int',
'size' => 5,
'minvalue' => 0,
'maxvalue' => 4294967295,
'default' => '0');

$fieldspec['kontakt_name'] = array('type' => 'string',
'size' => 50,
'required' => 'y');

$fieldspec['kontakt_vorname'] = array('type' => 'string',
'size' => 50);

$fieldspec['kontakt_strasse'] = array('type' => 'string',
'size' => 100);

$fieldspec['kontakt_lkz'] = array('type' => 'string',
'size' => 10);

$fieldspec['kontakt_plz'] = array('type' => 'string',
'size' => 10);

$fieldspec['kontakt_ort'] = array('type' => 'string',
'size' => 50);

$fieldspec['kontakt_telefon_privat'] = array('type' => 'string',
'size' => 30);

$fieldspec['kontakt_telefon_arbeit'] = array('type' => 'string',
'size' => 30);

$fieldspec['kontakt_telefon_mobil'] = array('type' => 'string',
'size' => 30);

$fieldspec['kontakt_email'] = array('type' => 'string',
'size' => 50);

$fieldspec['kontakt_fax'] = array('type' => 'string',
'size' => 50);

$fieldspec['kontakt_geburtstag'] = array('type' => 'date',
'size' => 12);

$fieldspec['kontakt_wurfhand'] = array('type' => 'string',
'size' => 2,
'default' => 'R');

$fieldspec['kontakt_position_id'] = array('type' => 'string',
'size' => 6,
'control' => 'dropdown',
'optionlist' => 'kkontakt_position_id');

$fieldspec['created_date'] = array('type' => 'datetime',
'size' => 20,
'required' => 'y',
'default' => '2014-01-01 00:00:00',
'autoinsert' => 'y',
'noedit' => 'y',
'nosearch' => 'y');

$fieldspec['created_user'] = array('type' => 'string',
'size' => 16,
'required' => 'y',
'autoinsert' => 'y',
'noedit' => 'y',
'nosearch' => 'y');

$fieldspec['revised_date'] = array('type' => 'datetime',
'size' => 20,
'autoupdate' => 'y',
'noedit' => 'y',
'nosearch' => 'y');

$fieldspec['revised_user'] = array('type' => 'string',
'size' => 16,
'autoupdate' => 'y',
'noedit' => 'y',
'nosearch' => 'y');

// primary key details
$this->primary_key = array('user_id',
'user_seq_no');

// unique key details
$this->unique_keys = array();

// child relationship details
$this->child_relations[] = array('child' => 'kontakte_ausruestung',
'type' => 'RES',
'fields' => array('user_id' => 'user_id',
'user_seq_no' => 'user_seq_no'));

$this->child_relations[] = array('child' => 'mannschaften_kontakte',
'type' => 'RES',
'fields' => array('user_id' => 'kontakt_ma_user_id',
'user_seq_no' => 'kontakt_ma_user_seq_no'));

$this->child_relations[] = array('child' => 'spiele_transport',
'type' => 'RES',
'fields' => array('user_id' => 'transport_user_id',
'user_seq_no' => 'transport_user_seq_no'));

$this->child_relations[] = array('child' => 'spiele_transport_mitfahrer',
'type' => 'RES',
'fields' => array('user_id' => 'mitfahrer_user_id',
'user_seq_no' => 'mitfahrer_user_seq_no'));

// parent relationship details
$this->parent_relations[] = array('parent' => 'kontakte_position',
'fields' => array('kontakt_position_id' => 'kontakt_position_id',
'rdcaccount_id' => 'rdcaccount_id'));

$this->parent_relations[] = array('parent' => 'kontakte_typ',
'fields' => array('kontakt_typ_id' => 'kontakt_typ_id',
'rdcaccount_id' => 'rdcaccount_id'));

$this->parent_relations[] = array('parent' => 'mnu_account',
'dbname' => 'menu',
'subsys_dir' => 'menu',
'fields' => array('rdcaccount_id' => 'rdcaccount_id'));

// determines if database updates are recorded in an audit log
$this->audit_logging = TRUE;

// default sort sequence
$this->default_orderby = '';

// alternative language options
$this->alt_language_table = '';
$this->alt_language_cols = '';

// alias names
$this->nameof_start_date = '';
$this->nameof_end_date = '';

// finished
?><?php
// report structure for a LIST view

$structure['pdf'] = array('orientation' => 'L', // L=Landscape, P=Portrait
'units' => 'mm', // pt=Point, mm=Millimeter, cm=Centimeter, in=Inch
'format' => 'A4', // A3, A4, A5, Letter, Legal
'name' => '', // filename (if destination = D or F)
'destination' => 'I'); // I=Inline (browser), D=Download (browser), F=Filename (on server), S=String

$structure['title']['style'] = 'title'; // style for page title
$structure['head']['style'] = 'hdg'; // style for column headings
$structure['body']['style'] = 'body'; // style for main body
$structure['foot']['style'] = 'foot'; // style for page footer

// define contents of page title
$structure['title'][] = array('text' => '- Kontakte -',
'width' => 100,
'align' => 'center',
'border' => 'y');

// set column widths
$structure['columns'][] = array('width' => '20', 'overflow' => 'y'); // Name
$structure['columns'][] = array('width' => '20', 'overflow' => 'y'); // Vorname
$structure['columns'][] = array('width' => '20', 'overflow' => 'y'); // Strasse
$structure['columns'][] = array('width' => '10', 'overflow' => 'y'); // LKZ
$structure['columns'][] = array('width' => '10', 'overflow' => 'y'); // PLZ
$structure['columns'][] = array('width' => '20', 'overflow' => 'y'); // Ort

// identify column names and associated labels
$structure['body']['fields'][] = array('kontakt_name' => 'Name');
$structure['body']['fields'][] = array('kontakt_vorname' => 'Vorname');
$structure['body']['fields'][] = array('kontakt_strasse' => 'Strasse');
$structure['body']['fields'][] = array('kontakt_lkz' => 'LKZ');
$structure['body']['fields'][] = array('kontakt_plz' => 'PLZ');
$structure['body']['fields'][] = array('kontakt_ort' => 'Ort');

// define contents of page footer
$structure['foot1'][] = array('type' => 'date', 'align' => 'left', 'style' => 'textalignleft');
$structure['foot1'][] = array('type' => 'pageno', 'align' => 'center');
$structure['foot1'][] = array('type' => 'time', 'align' => 'right', 'style' => 'textalignright');
$structure['foot2'][] = array('text' => 'This is a piece of text', 'align' => 'center');

?>

Can you see something wrong?

And the report file:



?>

The dict.inc file:

Re: Error running output2 pattern [message #4342 is a reply to message #4341] Sat, 12 July 2014 03:15 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
I repeat, none of the tasks which I generate using the OUTPUT2 pattern exhibit this behaviour, therefore the problem does not exist in my code.

I suggest you find a way of seeing what is being output to cause this error. You might want to use a debugger so that you can step through the code line by line and see what is being written to the output buffer.


Re: Error running output2 pattern [message #4343 is a reply to message #4342] Sun, 13 July 2014 04:45 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
You might also want to try using the output buffering functions in PHP to trap and flush any erroneous output before attempting to produce the PDF file.

Re: Error running output2 pattern [message #4344 is a reply to message #4343] Sun, 13 July 2014 05:13 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
Thank you very much for the hint. I will do so and hopefully get the error.
Re: Error running output2 pattern [message #4350 is a reply to message #4344] Wed, 16 July 2014 06:11 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I found the error (at least for my web environment).

I uncommented the following lines (7591-7593) in the file /includes/tcpdf/tcpdf_php5.php.

// Send PDF to the standard output
// if (ob_get_contents()) {
// $this->Error('Some data has already been output, can\'t send PDF file');
// }

With var_dump(ob_get_contents()); I got different values when I opened one of your reports e.g. for database tables (string(0) "") and one of my generated reports (string(3) "").

I think you will know where these different values come from and maybe change the code. For me it works fine with this lines commenting out.
Re: Error running output2 pattern [message #4351 is a reply to message #4350] Wed, 16 July 2014 07:48 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
If the result of var_dump(ob_get_contents()) is an empty string in one of my reports, but string(3) in one of your reports, it means that your report is sending blank characters to the output stream when it should not. You need to find this problem in your code and fix it.

Re: Error running output2 pattern [message #4352 is a reply to message #4351] Wed, 16 July 2014 09:19 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I checked again the output2.php file and the list.report.inc file and commented out every blank line. The same result.
Am I right that these are all the files which are involved in the pdf process?
I get this error even if I generate the code with Radicore without touching or even opening the files.
I have no more idea where I can search for this fault, maybe it comes from a different collation or from my ISP!?! In the beginning I had also problems to get the logon screen. Increasing certain settings solved the problem with mod_fcgid.
As far as I am concerned at the moment I will let these three lines commented out.
Thanks a lot for your patience.
Re: Error running output2 pattern [message #4452 is a reply to message #4352] Wed, 13 August 2014 05:03 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
Is there a UML diagram which shows the workflow of the PDF creating?
I try to step through the code with xdebug but I get problems because there are too many lines.
If I knew the workflow of the methods I could better set the break points.
Re: Error running output2 pattern [message #4453 is a reply to message #4452] Wed, 13 August 2014 06:28 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
You don't need to step through any of the code which actually produces the PDF document because the problem is being caused by something being written to the output stream BEFORE that point. You need to turn on output buffering then check the output from ob_get_length() as you step through your code. The length should remain at zero at all times until the PDF output is produced.

Re: Error running output2 pattern [message #4454 is a reply to message #4453] Wed, 13 August 2014 06:37 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
If I choose only one record for the pdf list there the following info: string '' (length=21), if I want to print all there is: string'' (length=63).
I get these information by adding the following lines in the tcpdf_php5.php:

public function Output($name='doc.pdf', $dest='I') {
//Output PDF to some destination
//Finish document if necessary
$out1 = ob_get_contents();
var_dump($out1);
Re: Error running output2 pattern [message #4455 is a reply to message #4454] Wed, 13 August 2014 06:54 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
This means that something wrote to the output stream BEFORE that point was reached. You need to find the place where the buffer length goes from zero to non-zero.

Re: Error running output2 pattern [message #4456 is a reply to message #4455] Wed, 13 August 2014 08:50 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
How can I do that?
I tried to step through the code from the beginning. But with no success because of the many code lines..
Do I have to set break points in every file I (Radicore) created by myself?
I use Eclipse (Luna) with xDebug. I worked with an integrated debugger in ObjectPAL but there I knew which function/method will be executed next or where I had to look for. With Radicore I will look for the error which is definitly coming from my system but I don't know where to look for the error nor how.
If I output the menu_pattern list the message is string '' (length=0)
Re: Error running output2 pattern [message #4457 is a reply to message #4456] Wed, 13 August 2014 10:59 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
The number of code lines is irrelevant. The trick is to step over a function to see if the error occurred in that function or not. If it did not then you can ignore that function, but if it did then you have to restart the debugging session and this time step into the function to see exactly which line causes the problem.

Re: Error running output2 pattern [message #4533 is a reply to message #4457] Mon, 08 September 2014 12:20 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I still struggle with the problem to output pdf files.
For output2 pattern I have inserted ob_clean(); in line 7588 and it works.

switch($dest) {
case 'I': {
// Send PDF to the standard output
ob_clean();

if (ob_get_contents()) {
$this->Error('Some data has already been output, can\'t send PDF file');
}
Printing output3 pattern doesn't work, so I added var_dump(headers_list()); in line 7598

if (php_sapi_name() != 'cli') {
// send output to a browser
var_dump(headers_list());
header('Content-Type: application/pdf');

I got this array:

array (size=5)
0 => string 'X-Powered-By: PHP/5.4.7' (length=23)
1 => string 'Expires: Thu, 19 Nov 1981 08:52:00 GMT' (length=38)
2 => string 'Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0' (length=77)
3 => string 'Pragma: no-cache' (length=16)
4 => string 'Content-type: text/html' (length=23)

Can this be a problem with the php version 5.4.7?
I run Windows 7, MySQL 5.5.27 in a xampp environment.
Is your development environment the same or different?

[Updated on: Mon, 08 September 2014 12:36]

Report message to a moderator

Re: Error running output2 pattern [message #4534 is a reply to message #4533] Mon, 08 September 2014 12:52 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
There are 11 examples of the OUTPUT2 pattern in the Radicore download, and in the demonstration application which is available at http://www.radicore.org/demo.php, and none of these have the problem you describe. The problem must be because of code which you have generated, so you need to compare my code (which works) with your code (which fails).

You need to step through with your debugger to find exactly where the faulty output is being generated. I cannot do this unless you send me all of your code, and your database, so that I can run it through the debugger on my PC.


Re: Error running output2 pattern [message #4536 is a reply to message #4534] Tue, 09 September 2014 04:19 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
All your output2/3 pattern work fine with my system. But my created patterns do not.

I attached all my code and the menu, dict and htm database files in htm.zip.

Probably you will see on first sight what I did wrong. But I am very frustrated at the moment because I don't see my fault and I can't go further.

Many thanks in advance.
  • Attachment: htm.zip
    (Size: 454.10KB, Downloaded 784 times)
Re: Error running output2 pattern [message #4537 is a reply to message #4536] Tue, 09 September 2014 05:22 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
I unzipped that file and installed it into my test environment, but I am unable to run anything due to missing files. There are two items in the 'HTM' menu, but neither of them work. When I click on the tabs all I see are the following error messages:

File name 'htm_db_kontakte_typ(list1).php' does not exist
File name 'htm_db_tree_type(list1).php' does not exist

Please send me the missing files.

I will also need your database schema with some test data.


Re: Error running output2 pattern [message #4538 is a reply to message #4537] Tue, 09 September 2014 06:39 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I also can't find these missing files. I used the prefix htm_db_ but I changed it in htm_ only. I also searched the mnu_menu and the mnu_task table for these entries but I didn't find any of them.

Copying and renaming the files from htm_kontakte_typ(list1).php to htm_db_kontakte_typ(list1).php and x_tree_type(list1).php to htm_db_tree_type(list1).php should remove the error messages. These were the names of the files before the change.

I also included the sql files of them menu, dict and htm database in the htm.zip file. In htm.sql are all the tables with all data.
Re: Error running output2 pattern [message #4539 is a reply to message #4538] Tue, 09 September 2014 06:56 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
You did not supply the export files with the expected names nor in the expected directories. Please do the following:
1) Go to Menu -> Subsystem, select 'HTM' and press the 'Export' button. This will create the file 'htm.menu_export.sql' in the 'sql' directory.
2) Go to Dictionary -> Database, select 'HTM' and press the 'Export' button. This will create the file 'htm.dict_export.sql' in the 'sql' directory.

I do *NOT* want a dump of your entire menu and dictionary databases, just those export files for the single subsystem.

Your database schema is supposed to be contained in the 'htm/sql/mysql/ directory, not the 'htm' directory.


Re: Error running output2 pattern [message #4542 is a reply to message #4539] Wed, 10 September 2014 04:06 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I added the files to htm_export.zip. I hope that you now have all the files you need.
In htm/sql/mysql/ there are no files. If you need another thing please let me know.
Sorry for my lack of knowledge how to deal with the right way.
Re: Error running output2 pattern [message #4545 is a reply to message #4542] Wed, 10 September 2014 09:08 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
This was a tricky error! It was caused by a Byte Order Mark being output when a UTF8-encoded language_text.inc file was included when performing the getLanguageText() function. I have changed the code in std.pdf.class.inc to turn on output buffering and to remove any Byte Order Mark before attempting to output the PDF document. See attached zip file for the amended scripts.

Re: Error running output2 pattern [message #4546 is a reply to message #4545] Wed, 10 September 2014 09:19 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
Thank you very much for the fix. I copied the files in the include directory and everything works fine now.
But why didn't you get the error? Was it because of such a specific situation or because of different development environments?
Re: Error running output2 pattern [message #4547 is a reply to message #4546] Wed, 10 September 2014 09:49 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
The error occurred because your file \htm\text\en\language_text.inc was encoded as UTF-8 whereas mine was encoded in Windows 1252 (Latin1). Your file had a Byte Order Mark whereas mine did not. It would appear that when a UTF-8 file is included the Byte Order Mark is written to the output stream.

Previous Topic: Dropdown list
Next Topic: output2 with parent/child tables
Goto Forum:
  


Current Time: Thu Mar 28 06:23:55 EDT 2024

Total time taken to generate the page: 0.01764 seconds