SpiceCRM

Can't get KReporter (Slim) to work

I’m not able to get KREST to work.
I’ve checked whether rewrite is working and it is.

For debugging I turned on “display_errors” in index.php.
When I open e.g. /KREST/sysinfo I see the following error:

Fatal error: Call to undefined method Slim\Http\Headers::extract() in /Users/johnezs/Sites/SuiteCRM-7.10/KREST/Slim/Environment.php on line 161

Any idea what might be causing this?

I’m running it on a Mac running Apache.

John,
Which KReporter Version and which KREST version did you install?
Which PHP version?
Val

Apache/2.4.28 (Unix)
PHP/5.5.38

KReporter v4.2.0
KREST Core v2.5.3 (I tried v2.5.2 as well)

PHP 5.6 is minimum recommended.
5.5 should work but it might be the problem. Before you consider an update:

Have you checked access right on all KREST/Slim files?

Does your KREST/Slim folder look like

Val

Yes that’s my folder structure. With 5 files in the “Middleware” folder.

Yes all files belong to u:g for apache user with chmod 777.

I have upgraded my PHP to Version 5.6.33.

Apache/2.4.28 (Unix) PHP/5.6.33

Now I get a slightly more verbose error message :slight_smile:

What are your settings in php.ini for error_reporting?

I seem to have multiple .ini files that get picked up. According to phpinfo it’s currently set to

32767 E_ALL (integer)

(keep in mind I turned on “display_errors” in KREST’s index.php as well for debugging this problem)

Please set to E_ALL & ~E_STRICT
Then turn off “display_errors” in KREST’s index.php
Then try to call krest/sysinfo again

That’s what I started with. I turned on display_errors in KREST’s index.php to get some idea of what’s going on.

This is what I get in Chrome when display_errors is off.

John,

ok. Then you still get the error "undefined method slim\Http\Headers::extract()"
It might an include path problem.
in kREST/index.php
there is on line 33 there is
chdir(dirname(FILE) . ‘/…/’);

This line should throw a warning in php error log if something is wrong. Do you find any warning in error log?
Val

Hi, i’m stucked in the same situation.

Apache/2.4.37 (Windows)
PHP/5.6.40

KReporter v4.2.0
KREST Core v2.5.3

In php.ini
i’ve set

display_errors = E_ALL & ~E_STRICT

in KREST/index.php i’ve set

ini_set('error_reporting', 'E_ALL & ~E_STRICT');
ini_set("display_errors", "off");

When I open e.g. /KREST/sysinfo I see the following error in php error_log

[29-Aug-2019 14:01:19 UTC] PHP Fatal error:  Call to undefined method Slim\Http\Headers::extract() in C:\wamp64\www\Sviluppo\KREST\Slim\Environment.php on line 162

[29-Aug-2019 14:01:19 UTC] PHP Stack trace:

[29-Aug-2019 14:01:19 UTC] PHP   1. {main}() C:\wamp64\www\Sviluppo\KREST\index.php:0

[29-Aug-2019 14:01:19 UTC] PHP   2. Slim\Slim->__get() C:\wamp64\www\Sviluppo\KREST\index.php:42

[29-Aug-2019 14:01:19 UTC] PHP   3. Slim\Helper\Set->get() C:\wamp64\www\Sviluppo\KREST\Slim\Slim.php:234

[29-Aug-2019 14:01:19 UTC] PHP   4. Slim\Helper\Set->Slim\Helper\{closure}() C:\wamp64\www\Sviluppo\KREST\Slim\Helper\Set.php:88

[29-Aug-2019 14:01:19 UTC] PHP   5. Slim\Slim->Slim\{closure}() C:\wamp64\www\Sviluppo\KREST\Slim\Helper\Set.php:228

[29-Aug-2019 14:01:19 UTC] PHP   6. Slim\Helper\Set->offsetGet() C:\wamp64\www\Sviluppo\KREST\Slim\Helper\Set.php:164

[29-Aug-2019 14:01:19 UTC] PHP   7. Slim\Helper\Set->get() C:\wamp64\www\Sviluppo\KREST\Slim\Helper\Set.php:185

[29-Aug-2019 14:01:19 UTC] PHP   8. Slim\Helper\Set->Slim\Helper\{closure}() C:\wamp64\www\Sviluppo\KREST\Slim\Helper\Set.php:88

[29-Aug-2019 14:01:19 UTC] PHP   9. Slim\Slim->Slim\{closure}() C:\wamp64\www\Sviluppo\KREST\Slim\Helper\Set.php:228

[29-Aug-2019 14:01:19 UTC] PHP  10. Slim\Environment::getInstance() C:\wamp64\www\Sviluppo\KREST\Slim\Slim.php:159

[29-Aug-2019 14:01:19 UTC] PHP  11. Slim\Environment->__construct() C:\wamp64\www\Sviluppo\KREST\Slim\Environment.php:76

In which crm + crm version did you install KReporter 4.2?

Hi Val, thanks for answering me.

I’m in SuiteCRM v. 7.10.14

on Unix environment this issue was solved updating the permissions of the KREST Folder to 0755
on Windows i haven’t solved it yet.

SuiteCRM 7.10 is your problem.
Try renaming vendor/slim folder to somthing else- vendor/slim_ for example.

Hi Val, thank you.
I renamed vendor/slim folder to vendor/slim_

Now i’m able to select modules from the drop down and to drag&drop fields.

But i can’t create any report.
When working in KReport edit view i see:

Declaration of KReport::create_new_list_query() should be compatible with SugarBean::create_new_list_query($order_by, $where, $filter = Array, $params = Array, $show_deleted = 0, $join_type = ‘’, $return_array = false, $parentbean = NULL, $singleSelect = false, $ifListForExport = false) in C:\wamp64\www\Sviluppo\modules\KReports\KReport.php on line 2035

PS: evironment is
PHP 5.6.40
Apache 2.4.37

If i click save i get a KReport record without any info.
This is the dump:

INSERT INTO `kreports` (`id`, `name`, `date_entered`, `date_modified`, `modified_user_id`, `created_by`, `description`, `deleted`, `assigned_user_id`, `report_module`, `report_status`, `union_modules`, `reportoptions`, `listtype`, `listtypeproperties`, `selectionlimit`, `presentation_params`, `visualization_params`, `integration_params`, `wheregroups`, `whereconditions`, `listfields`, `unionlistfields`, `advancedoptions`, `category_id`, `category_priority`) VALUES
('f3d2e41d-e25a-825e-d942-5d691b2fe4ee', 'new Report', '2019-08-30 12:51:16', '2019-08-30 13:06:36', '1', '1', NULL, 0, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '[]', '[]', NULL, NULL, NULL, '', NULL);

As long you have no fatal error, php log is ok.

Do you use default SuiteCRM theme?
And do you click the save button within KReporter Interface and not the default SuiteCRM SAVE button?

Thank you Val; i was clicking the SuiteCRM save button.
Yes, i’m using the default SuiteP theme.

After clicking on the Save button in KReporter interface, i’m able to see now some results.
image

Do you think it would be difficult to merge the SuiteCRM interface with the KReporter one?

With next KReporter version 4.4 we wil deliver a KReporter SuiteCRM extension which will hide the SuiteCRM button. Publication by the end of October. Hopefully. Should already have been published much earlier.