Topic: How is ‘path_to_root’ set? Or how to reset the working directory?
How is ‘path_to_root’ set? Or how to reset the working directory?
I am writing a small extension to add some additional fields to customers.
So sales/manage/customers.php
Is now modules/additional_fields/manage/ customers.php
File: /additional_fields/manage/customers.php
Line 13: $path_to_root = "../..";
Is changed to:-
Line 13: $path_to_root = "../../..";
The necessary code is added for the additional fields which work as expected.
However, clicking on the Transactions tab the following error (and 4 others similar appear):-
include_once(../../includes/db_pager.inc): failed to open stream: No such file or directory in file: /sales/inquiry/customer_inquiry.php at line 14
/sales/inquiry/customer_inquiry.php:14: include_once()
modules/additional_fields/manage/add_customers.php:449: include_once(' /sales/inquiry/customer_inquiry.php')
And
include_once(): Failed opening '../../includes/db_pager.inc' for inclusion (include_path='.;C:\php\pear') in file: sales\inquiry\customer_inquiry.php at line 14
sales\inquiry\customer_inquiry.php:14: include_once()
modules\additional_fields\manage\add_customers.php:450: include_once('sales\inquiry\customer_inquiry.php')
(Similar errors appear on the Sales Orders tab)
If the path_to_root in customer_inquiry.php is changed to ../../.. then it works, but obviously now I cannot access Sales -> Customer Transaction Inquiry as numerous fatal errors appear.
How do I reset the working directory?