Cannot access documents

rdh61 wrote on Friday, September 19, 2014:

Hi,

I cannot see my documents in openemr, i.e. the documents tree does not appear when I select “Documents” in the active patient. I know they are there because I can access them in /openemr/sites/default/documents.

I think this fault might have occurred during the steps taken to resolve this issue:
https://sourceforge.net/p/openemr/discussion/202505/thread/166f16ab/?limit=25#0e52

I have found this thread which may be relevant but I have difficulty in following the technical discussion:
https://sourceforge.net/p/openemr/discussion/202506/thread/4b7e36d2/

Any help gratefully received.

fsgl wrote on Friday, September 19, 2014:

Did you copy & paste the openemr web directory from Lubuntu 13.10 or did you use the restore script?

rdh61 wrote on Friday, September 19, 2014:

In the earlier stages I copied and pasted as you suggested, then at the end, when I had a good backup from the other computer (the one that would not back up), I used the restore script.

P.S. All my systems are now upgraded to Lubuntu 14.04.

fsgl wrote on Friday, September 19, 2014:

I presumed the Documents tree had been available in 14.04 & now you’re getting a blank screen after clicking the Documents link. What changes, if any, did you make in the interim?

What’s in the error logs?

rdh61 wrote on Saturday, September 20, 2014:

You presumed correctly. The only changes made were those involved in attempting (eventually with success) to produce and restore a working back up, described in the link given above. To be honest I cannot remember exactly what I did when and what I didn’t do!

The mysql error log is empty.

The apache2 error log gave the following output (at the time of selecting “Documents” and getting a blank window):

[Sat Sep 20 11:23:01.740721 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined property: CategoryTree::$root_type in /var/www/openemr/library/classes/Tree.class.php on line 54, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.761876 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 0 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.762445 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 0 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.762676 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 6 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.762824 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 7 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.763095 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 8 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.763178 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 5 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.763496 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 11 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.763607 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 10 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.764856 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 4 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.765105 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 9 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.765160 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Notice: Undefined offset: 1 in /var/www/openemr/controllers/C_Document.class.php on line 1049, referer: http://localhost/openemr/interface/main/left_nav.php
[Sat Sep 20 11:23:01.804587 2014] [:error] [pid 10515] [client 127.0.0.1:37474] PHP Fatal error: Smarty error: unable to write to $compile_dir ‘/var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled’. Be sure $compile_dir is writable by the web server user. in /var/www/openemr/library/Smarty.class.php on line 1102, referer: http://localhost/openemr/interface/main/left_nav.php

yehster wrote on Saturday, September 20, 2014:

Fatal error: Smarty error: unable to write to $compile_dir ‘/var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled’. Be sure $compile_dir is writable by the web server user. in /var/www/openemr/library/Smarty.class.php on line 1102, referer:

Your solution is right there in the log…

visolveemr wrote on Saturday, September 20, 2014:

Yes, This directory need to be writable by the webserver.
You can make use of the below command to change the access

chown -R www-data:www-data /var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled

Thanks
OpenEMR Customization/Support Team,
ViSolve Inc
services@visolve.com
Demo’s @ ViSolve Demo Library

fsgl wrote on Saturday, September 20, 2014:

Most relevant article from group.

Explanation of permissions & chmod.

Try this command:
sudo chmod 766 /var/www/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled

I checked the permissions for that folder in my test copy. The ls command gives 744 which does not make sense. If changing permissions works, it does not have to make sense.

fsgl wrote on Saturday, September 20, 2014:

To minimize security breaches, checked this Wiki page & found that your problematic folder not mentioned.

yehster wrote on Saturday, September 20, 2014:

Updating the permissions will likely restore your ability to browse the document categories, but there is a possibility that existing documents aren’t going to display correctly because of other path/folder changes that occurred during your migration.

rdh61 wrote on Saturday, September 20, 2014:

Thank you for that command ViSolve. My documents are now displaying correctly (including all existing documents Kevin). Thanks fsgl also for the additional links. Problem solved.

nik1977 wrote on Monday, May 16, 2016:

We are using OpenEMR on Windows environment. We are having the same problem with the Document link. Any help?