HTTP Error 500 After Click Privacy Statement

I get error 500 when clicking Privacy Statement (…/about/privacy), previously the error that appeared was 404 but later it changed. Currently I am using OMP version 3.4.0.8 and using the default theme

Hi @mi.amal,

For 500 errors, or other behaviors where an operation is not completing it is best to check your PHP error logs and report back on messages found there.
If unsure of how to do that, please see here: How do I find my PHP error log?

-Roger
PKP Team

This is my error log on my web

[14-Jan-2025 14:56:12 America/New_York] omp: 404 Not Found
[14-Jan-2025 14:56:12 America/New_York] omp: 404 Not Found
[14-Jan-2025 14:56:12 America/New_York] omp: 404 Not Found
[14-Jan-2025 14:56:28 America/New_York] omp: 404 Not Found
[14-Jan-2025 18:25:43 America/New_York] PHP Warning: Undefined variable $enableSiteWidePrivacyStatement in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 82
[14-Jan-2025 18:25:43 America/New_York] PHP Warning: Undefined variable $context in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 82
[14-Jan-2025 18:25:43 America/New_York] PHP Warning: Undefined variable $request in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 85
[14-Jan-2025 18:25:43 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function getSite() on null in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php:85
Stack trace:
#0 /home/afsonni/public_html/23publishing.id/lib/pkp/lib/vendor/composer/ClassLoader.php(576): include()
#1 /home/afsonni/public_html/23publishing.id/lib/pkp/lib/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}()
#2 /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/index.php(28): Composer\Autoload\ClassLoader->loadClass()
#3 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/PKPPageRouter.php(223): require(‘/home/afsonni/p…’)
#4 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route()
#5 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher->dispatch()
#6 /home/afsonni/public_html/23publishing.id/index.php(21): PKP\core\PKPApplication->execute()
#7 {main}
thrown in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 85

Hi @mi.amal,

Can you start by confirming that you have set a privacy statement for the press in all languages you have enabled? You can check this in Settings > Website > Setup > Privacy Statement.

I don’t think it’s the cause of your issue, but one of the warnings in your log may be resolved by updating your config.inc.php and adding the following setting, usually found in the “General Settings” area just after enable_beacon:

; Set this to "On" if you would like to only have a single, site-wide Privacy
; Statement, rather than a separate Privacy Statement for each press. Setting
; this to "Off" will allow you to enter a site-wide Privacy Statement as well
; as separate Privacy Statements for each press.
sitewide_privacy_statement = Off

I have set privacy statement in all language, my privacy statement appear in …/about/submission with author guidelines, submission preparation checklist, and copyright notice.

My config.inc.php for sitewide_privacy_statement is on by default, I have tried to set it off, but error 500 appear

[15-Jan-2025 10:02:15 America/New_York] PHP Warning: Undefined variable $enableSiteWidePrivacyStatement in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 82
[15-Jan-2025 10:02:15 America/New_York] PHP Warning: Undefined variable $context in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 82
[15-Jan-2025 10:02:15 America/New_York] PHP Warning: Undefined variable $request in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 85
[15-Jan-2025 10:02:15 America/New_York] PHP Fatal error: Uncaught Error: Call to a member function getSite() on null in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php:85
Stack trace:
#0 /home/afsonni/public_html/23publishing.id/lib/pkp/lib/vendor/composer/ClassLoader.php(576): include()
#1 /home/afsonni/public_html/23publishing.id/lib/pkp/lib/vendor/composer/ClassLoader.php(427): Composer\Autoload{closure}()
#2 /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/index.php(28): Composer\Autoload\ClassLoader->loadClass()
#3 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/PKPPageRouter.php(223): require(‘/home/afsonni/p…’)
#4 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route()
#5 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher->dispatch()
#6 /home/afsonni/public_html/23publishing.id/index.php(21): PKP\core\PKPApplication->execute()
#7 {main}
thrown in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 85

If you only have one press in your OMP instance, then that should be set to Off (it’s for installations which have multiple presses and they want to use the same privacy statement for every press).

sorry, I had edited my reply above and add error log

still have this error until now, I really didn’t know what happened here

[17-Jan-2025 03:58:31 America/New_York] PHP Warning:  Undefined variable $enableSiteWidePrivacyStatement in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 82
[17-Jan-2025 03:58:31 America/New_York] PHP Warning:  Undefined variable $context in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 82
[17-Jan-2025 03:58:31 America/New_York] PHP Warning:  Undefined variable $request in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 85
[17-Jan-2025 03:58:31 America/New_York] PHP Fatal error:  Uncaught Error: Call to a member function getSite() on null in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php:85
Stack trace:
#0 /home/afsonni/public_html/23publishing.id/lib/pkp/lib/vendor/composer/ClassLoader.php(576): include()
#1 /home/afsonni/public_html/23publishing.id/lib/pkp/lib/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#2 /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/index.php(28): Composer\Autoload\ClassLoader->loadClass()
#3 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/PKPPageRouter.php(223): require('/home/afsonni/p...')
#4 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route()
#5 /home/afsonni/public_html/23publishing.id/lib/pkp/classes/core/PKPApplication.php(395): PKP\core\Dispatcher->dispatch()
#6 /home/afsonni/public_html/23publishing.id/index.php(21): PKP\core\PKPApplication->execute()
#7 {main}
  thrown in /home/afsonni/public_html/23publishing.id/lib/pkp/pages/about/AboutSiteHandler.php on line 85

I have checked on other websites that I manage and use OMP version 3.4.0.7 and no problems like this occur.

In 23publishing.id (use OMP version 3.4.0.8) error 500 appear at:

  1. About Open Monograph Press
  2. Privacy Statement

Hi @mi.amal, have you made any changes to the file /lib/pkp/pages/about/AboutSiteHandler.php?

No, I don’t, the file is same as first installation, first error appear about seferal days after installation and bring error 404 then change to 500 on the web page

My only other thought is that it could be related to your URL rewriting setup - could you provide more details on how you have set that up, e.g. any .htaccess customizations or other server settings for rewriting the URLs?

And did you install OMP from the release package on https://pkp.sfu.ca/software/omp/download/?

And what do you have set for your base_url[..] settings in your config.inc.php?

This is my .htaccess setting

<IfModule mod_rewrite.c>
    RewriteEngine on
#    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

This is my config.inc.php setting

; The canonical URL to the OMP installation (excluding the trailing slash)
base_url = "https://23publishing.id"

I installed OMP from Softaculous which is used on my hosting service. Previously I had installed OMP on a different website but using version 3.4.0.7 and everything worked normally. However, on 23publishing.id which uses OMP version 3.4.0.8, this problem appears.

Hi @mi.amal,

I think your OMP has been modified, and that might explain the errors/warnings. The file lib/pkp/pages/about/AboutSiteHandler.php is clearly different from what’s included in the OMP 3.4.0-8 package, judging by the errors and warnings you report.

I would suggest comparing that file against a fresh download from https://pkp.sfu.ca/software/omp/download/.

Regards,
Alec Smecher
Public Knowledge Project Team