Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007936TestLinkChartspublic2017-05-12 20:052018-03-10 07:19
Reporteracoloma 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindowsOSWindows Server 2016 R2OS Version6.3.9600
Product Version1.9.16 (2016 Q4) 
Fixed in Version1.9.17 (2018 Q1) 
Summary0007936: Unable to display Charts - PHP 7.1
DescriptionWe are trying to upgrade TestLink from 1.9.8 to 1.9.16 but I have one issue here. I am unable to display the graphical charts. I only see broken links.

I am just an IT guy and not a Developer, with zero programming experience.

Please help.
Steps To ReproduceTest Reports and Metrics -> Charts
Additional InformationWhen I right click on the image and hit "View Image" in Chrome, I get the following error messages.
 
Graphical Report: Overall Metrics
URL: https://testlink.testdomain.com/lib/results/overallPieChart.php?apikey=&tplan_id=507135 [^]
Fatal error: Uncaught Error: Cannot use string offset as an array in C:\xampp\htdocs\testlink-1.9.16\third_party\pchart\pChart\pData.class:74 Stack trace: #0 C:\xampp\htdocs\testlink-1.9.16\lib\results\overallPieChart.php(46): pData->pData() #1 {main} thrown in C:\xampp\htdocs\testlink-1.9.16\third_party\pchart\pChart\pData.class on line 74

Graphical Report: Results by Keyword
URL: https://testlink.testdomain.com/lib/results/keywordBarChart.php?apikey=&tplan_id=507135&tproject_id=1 [^]
Fatal error: Uncaught Error: Cannot use string offset as an array in C:\xampp\htdocs\testlink-1.9.16\third_party\pchart\pChart\pData.class:74 Stack trace: #0 C:\xampp\htdocs\testlink-1.9.16\lib\results\charts.inc.php(90): pData->pData() #1 C:\xampp\htdocs\testlink-1.9.16\lib\results\keywordBarChart.php(34): createChart(Object(stdClass), Object(stdClass)) 0000002 {main} thrown in C:\xampp\htdocs\testlink-1.9.16\third_party\pchart\pChart\pData.class on line 74

Graphical Report: Results for Top Level Suites
URL: https://testlink.testdomain.com/lib/results/topLevelSuitesBarChart.php?apikey=&tplan_id=507135&tproject_id=1 [^]
Fatal error: Uncaught Error: Cannot use string offset as an array in C:\xampp\htdocs\testlink-1.9.16\third_party\pchart\pChart\pData.class:74 Stack trace: #0 C:\xampp\htdocs\testlink-1.9.16\lib\results\charts.inc.php(90): pData->pData() #1 C:\xampp\htdocs\testlink-1.9.16\lib\results\topLevelSuitesBarChart.php(39): createChart(Object(stdClass), Object(stdClass)) 0000002 {main} thrown in C:\xampp\htdocs\testlink-1.9.16\third_party\pchart\pChart\pData.class on line 74
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
BrowserChrome, IE & Firefox
PHP VersionPHP 7.1.2
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Filespng file icon Testlink Charts -1.png [^] (35,786 bytes) 2017-05-15 15:55

- Relationships
related to 0008220closedfman Unable to display Charts - PHP 7.11 
child of 0007817closedfman Availables hot-fixes for 1.9.16 & How To get full fixed package from GitHub 

-  Notes
(0026346)
acoloma (reporter)
2017-05-12 20:30
edited on: 2017-05-12 20:31

[Fri May 12 16:20:29.470681 2017] [php7:error] [pid 6104:tid 1720] [client 192.168.215.50:62151] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in C:\\xampp\\htdocs\\testlink-1.9.16\\third_party\\pchart\\pChart\\pData.class:74\nStack trace:\n#0 C:\\xampp\\htdocs\\testlink-1.9.16\\lib\\results\\overallPieChart.php(46): pData->pData()\n#1 {main}\n thrown in C:\\xampp\\htdocs\\testlink-1.9.16\\third_party\\pchart\\pChart\\pData.class on line 74, referer: http://testlink.testdomain.com/lib/results/charts.php?format=0&tplan_id=507135 [^]

[Fri May 12 16:20:29.548809 2017] [php7:error] [pid 6104:tid 1724] [client 192.168.215.50:62148] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in C:\\xampp\\htdocs\\testlink-1.9.16\\third_party\\pchart\\pChart\\pData.class:74\nStack trace:\n#0 C:\\xampp\\htdocs\\testlink-1.9.16\\lib\\results\\charts.inc.php(90): pData->pData()\n#1 C:\\xampp\\htdocs\\testlink-1.9.16\\lib\\results\\keywordBarChart.php(34): createChart(Object(stdClass), Object(stdClass))\n#2 {main}\n thrown in C:\\xampp\\htdocs\\testlink-1.9.16\\third_party\\pchart\\pChart\\pData.class on line 74, referer: http://testlink.testdomain.com/lib/results/charts.php?format=0&tplan_id=507135 [^]

[Fri May 12 16:20:29.626937 2017] [php7:error] [pid 6104:tid 1716] [client 192.168.215.50:62153] PHP Fatal error: Uncaught Error: Cannot use string offset as an array in C:\\xampp\\htdocs\\testlink-1.9.16\\third_party\\pchart\\pChart\\pData.class:74\nStack trace:\n#0 C:\\xampp\\htdocs\\testlink-1.9.16\\lib\\results\\charts.inc.php(90): pData->pData()\n#1 C:\\xampp\\htdocs\\testlink-1.9.16\\lib\\results\\topLevelSuitesBarChart.php(39): createChart(Object(stdClass), Object(stdClass))\n#2 {main}\n thrown in C:\\xampp\\htdocs\\testlink-1.9.16\\third_party\\pchart\\pChart\\pData.class on line 74, referer: http://testlink.testdomain.com/lib/results/charts.php? [^]

(0026347)
fman (administrator)
2017-05-13 07:24

1) get latest stable code, do fresh install on sandbox, retest & provide feedback.
2) mode detailed steps to reproduce are needed, because is impossible reproduce an unknown scenario
(0026362)
acoloma (reporter)
2017-05-15 15:54

Thanks fman!

Correct me if I'm wrong but I believe I used the latest code by installing the latest version, TestLink Stable (NEW!!!! - 1.9.16 - Moka Pot - 20170121), from Sourceforge.
https://sourceforge.net/projects/testlink/files/TestLink%201.9/TestLink%201.9.16/testlink-1.9.16.tar.gz/download [^]

As for your 2nd suggestion, did you meant more detailed steps to reproduce are needed?
If so, here are the steps I have taken to upgrade then test TestLink from 1.9.8 to the latest version, 1.9.16.
1. Exported the testlink 1.9.8 database from production using MySQL Workbench
2. Download the latest XAMPP for Windows [7.1.2 / PHP 7.1.2] from Apache Friends and installed it using default settings
https://www.apachefriends.org/download.html [^]
xampp-win32-7.1.2-0-VC14-installer.exe
Apache/2.4.25 (Win32)
PHP 7.1.2
10.1.21-MariaDB

3. Launch XAMPP Control Panel, C:\xampp\xampp-control.exe, to test the Apache and MySQL modules required by Testlink by starting both modules
The tool will show which module have issue like Apache will not start if the Windows Web Server IIS is installed and running
4. Download the latest or required Teslink version and extract it into C:\xampp\htdocs
5. Configure System Environemnt Variables
Add C:\xampp\php and C:\xampp\mysql\bin into the the environment varianble PATH
6. Configure Apache
  a. C:\xampp\apache\conf\extra\httpd-ssl.conf
    <VirtualHost _default_:443>
    DocumentRoot "C:/xampp/htdocs/testlink-1.9.16"
    ServerName testlink.testdomain.com:443
    ServerAdmin it@testdomain.com
    ErrorLog "C:/xampp/apache/logs/error.log"
    TransferLog "C:/xampp/apache/logs/access.log"
    SSLEngine on
    SSLCertificateFile "conf/ssl.crt/testdomain.com.crt"
    SSLCertificateKeyFile "conf/ssl.key/apache_testdomain.com.key"
    </VirtualHost>

b. Copy the wildcard certificate and key into C:\xampp\apache\conf\ssl.crt and C:\xampp\apache\conf\ssl.key respectively
7. Configure Testlink
  a. C:\xampp\htdocs\testlink-1.9.16\config.inc.php
    i. Log and Repository Paths
    $tlCfg->log_path = 'C:\xampp\htdocs\testlink-1.9.16\logs'; /* unix example */
    $g_repositoryPath = 'C:\xampp\htdocs\testlink-1.9.16\upload_area'; /* unix example */

    ii. Messaging
    $g_smtp_host = 'smtp.testdomain.com'; # SMTP server MUST BE configured
    $g_tl_admin_email = 'it@testdomain.com'; # for problem/error notification
    $g_from_email = 'testlink.testdomain.com.com'; # email sender
    $g_return_path_email = 'testlink.testdomain.com.com';

    iii. Authentication
    Copy C:\xampp\php\ext\php_ldap.dll to C:\xampp\apache\bin\php_ldap.dll

    $tlCfg->authentication['method'] = 'LDAP';
    $tlCfg->authentication['ldap_server'] = '192.168.1.8';
    $tlCfg->authentication['ldap_port'] = '389';
    $tlCfg->authentication['ldap_version'] = '3'; // could be '2' in some cases
    $tlCfg->authentication['ldap_root_dn'] = 'dc=testdomain,dc=com';
    $tlCfg->authentication['ldap_bind_dn'] = 'BindDN'; // Left empty for anonymous LDAP binding
    $tlCfg->authentication['ldap_bind_passwd'] = 'BindDNPassword'; // Left empty for anonymous LDAP binding
    $tlCfg->authentication['ldap_tls'] = false; // true -> use tls
    $tlCfg->authentication['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)'
    $tlCfg->authentication['ldap_uid_field'] = 'sAMAccountName'; // Use 'sAMAccountName' for Active Directory

8. Start the upgrade by browsing to the server using the URL: https://testlink.testdomain.com.com [^] and follow the instructions.
9. Import the backup data from prodcution that was exported earlier.
10. Visit the site again and this time it should prompt you to upgrade the database to 1.9.16 manually
    You need to proceed with Manual upgrade of your DB scheme to DB 1.9.16 - Read README file!
11. Apply all the database changes from the current production version (1.9.8) to the latest version (1.9.16)
    i. Login to the testlink database
    ii. Run all scripts from 1.9.9 to 1.9.16 using the source command
            ex. MariaDB [testlink]>source C:\xampp\htdocs\testlink-1.9.16\install\sql\alter_tables\1.9.9\mysql \DB.1.9.9\step1\db_schema_update.sql

12. Remove the "install", C:\xampp\htdocs\testlink-1.9.16\install, folder after the databse is updated.
13. Improve Testlink performance by modiying the following configuration files.
    a. C:\xampp\apache\conf\httpd.conf
    Timeout 3000

    b. C:\xampp\php\php.ini:
    default_socket_timeout = 600
    max_execution_time = 10080
    max_input_time = 600

    c. C:\xampp\mysql\bin\my.ini
    [mysqld]
    port= 3306
    socket = "C:/xampp/mysql/mysql.sock"
    basedir = "C:/xampp/mysql"
    tmpdir = "C:/xampp/tmp"
    datadir = "C:/xampp/mysql/data"
    pid_file = "mysql.pid"
    key_buffer = 128M
    max_allowed_packet = 100M
    table_cache = 512
    sort_buffer_size = 4M
    net_buffer_length = 1024K
    read_buffer_size = 4M
    read_rnd_buffer_size = 8M
    myisam_sort_buffer_size = 1024M
    log_error = "mysql_error.log"
    query_cache_size = 8192K
    thread_cache_size = 4
    net_read_timeout = 3600
    net_write_timeout = 3600
    delayed_insert_timeout = 1200
    max_user_connections = 500
    max_connections = 1000
    innodb_buffer_pool_size = 1024M
    innodb_additional_mem_pool_size = 20M
    innodb_log_file_size = 5M
    innodb_log_buffer_size = 25M
    innodb_flush_log_at_trx_commit = 1
    innodb_lock_wait_timeout = 6000

    [isamchk]
    key_buffer = 120M
    sort_buffer_size = 120M
    read_buffer = 12M
    write_buffer = 12M

    [myisamchk]
    key_buffer = 120M
    sort_buffer_size = 120M
    read_buffer = 12M
    write_buffer = 12M

Testing.
1. From the Desktop -> Test Reports and Metrics -> Charts
2. On the Graphical Reports, it just display broken links
(0026363)
acoloma (reporter)
2017-05-15 21:11

Sorry fman, I just found out that there are new codes from GitHub. I will try your suggestion and let you know of what the result.
Thanks for your time!
(0026374)
acoloma (reporter)
2017-05-17 17:01

Using the new codes from Github did not help.

Testing Steps.
1. From the Desktop -> Test Reports and Metrics -> Charts
2. On the Graphical Reports, it just display broken links
(0026384)
fman (administrator)
2017-05-18 19:08

OK, I'm going to check
(0026385)
fman (administrator)
2017-05-18 19:23

Issue is relates to PHP version, that does not allow to initialize to '', a variable that will be used as Array.
(0026387)
acoloma (reporter)
2017-05-18 19:36

Thanks! I will test and get back to you.
(0026405)
acoloma (reporter)
2017-05-25 19:53

Thank you so much fman! I really appreciate your quick response and fix to this issue.
It's amazingly working now.
(0026633)
Pollyanna Ramos (reporter)
2017-07-21 14:43

HELP! Estou com o mesmo problema, como corrijo?
I have the same problem, how do I correct it?

Database MySQL
Browser: Chrome, IE e Firefox
PHP Version: 7.1.4
testlink 1.9.16
xampp-win32-7.1.4
Windows 10 Pro

I await your return.

Pollyanna Ramos.
(0026653)
acoloma (reporter)
2017-07-27 14:35

Hi Pollyanna, first I apologize for the late reply but here is what I did.

Deploy 1.9.16 and instead of deploying the full latest code, I only picked the one that fixed the Graphical Reports and dropped them under "C:\xampp\htdocs\testlink-1.9.16\third_party\pchart"

The latest code can be downloaded form here. Hope this helps.
TestLinkOpenSourceTRMS/testlink-code
https://github.com/TestLinkOpenSourceTRMS/testlink-code/tree/testlink_1_9/ [^]
(0027254)
jmesanc@gmail.com (reporter)
2018-03-08 15:21
edited on: 2018-03-08 15:23

I had same problem, but NONE OF THE SOLUTIONS worked for me.

After a lot of hours of proofs and tracking, i ┬┤ve found that the problem:
-wasn't php version
-wasn't gd library
-wasn't my windows-iis-gdi implementation
-wasn't testlink version
-wasn't testlink gd configuration.

My solution:
============
1. Open config.inc.php file, in a text editor.

2. Deleting or comment line 68, his instruction "include_once('config_db.inc.php');" is the source of fail, i dont know why.

3. Anyway we need database access parameters, then in the line 69 include the follow lines:

define('DB_TYPE', 'mssql'); //my database provider is mssql.
define('DB_USER', 'MyDBUser');
define('DB_PASS', 'MyPassword');
define('DB_HOST', 'MyDBServer');
define('DB_NAME', 'MyDBName');
define('DB_TABLE_PREFIX', 'testlink'); //optional if you use prefix

And enjoy your app.

(0027256)
fman (administrator)
2018-03-09 18:37

a blank line at end of file can be the source of issue. Your solution is not applicable as standard
(0027257)
jmesanc@gmail.com (reporter)
2018-03-09 19:22

I can understand your statement, but anyway this problema should be reviewed more widely.

It took me a lot of time reach this solution, and i'm sure wasnt blank lines.

I belive is important to establish why the "include_once" line, raises the exception, even establish i'm wrong.

other people, with same or more pressure, than i had, could benefit.
(0027258)
fman (administrator)
2018-03-10 07:19

The incude_once method is in use for years and works without issues.
Do not think having or not charts can be considered a critic or blocking issue.

- Issue History
Date Modified Username Field Change
2017-05-12 20:05 acoloma New Issue
2017-05-12 20:30 acoloma Note Added: 0026346
2017-05-12 20:31 acoloma Note Edited: 0026346 View Revisions
2017-05-13 07:24 fman Note Added: 0026347
2017-05-15 15:54 acoloma Note Added: 0026362
2017-05-15 15:55 acoloma File Added: Testlink Charts -1.png
2017-05-15 21:11 acoloma Note Added: 0026363
2017-05-17 17:01 acoloma Note Added: 0026374
2017-05-18 19:08 fman Note Added: 0026384
2017-05-18 19:23 fman Note Added: 0026385
2017-05-18 19:24 fman QA Team - Task Workflow Status => TBD
2017-05-18 19:24 fman Summary Unable to display Charts => Unable to display Charts - PHP 7.1
2017-05-18 19:24 fman QA Team - Task Workflow Status TBD => READY FOR TESTING
2017-05-18 19:24 fman Status new => resolved
2017-05-18 19:24 fman Fixed in Version => 1.9.17 (2018 Q1)
2017-05-18 19:24 fman Resolution open => fixed
2017-05-18 19:24 fman Assigned To => fman
2017-05-18 19:25 fman Relationship added child of 0007817
2017-05-18 19:36 acoloma Note Added: 0026387
2017-05-25 19:53 acoloma Note Added: 0026405
2017-07-21 14:43 Pollyanna Ramos Note Added: 0026633
2017-07-27 14:35 acoloma Note Added: 0026653
2018-03-08 15:21 jmesanc@gmail.com Note Added: 0027254
2018-03-08 15:23 jmesanc@gmail.com Note Edited: 0027254 View Revisions
2018-03-09 18:37 fman Note Added: 0027256
2018-03-09 18:38 fman Relationship added related to 0008220
2018-03-09 19:22 jmesanc@gmail.com Note Added: 0027257
2018-03-10 07:19 fman Note Added: 0027258
2018-03-10 07:19 fman Status resolved => closed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker