Admin page not fully loaded

I just installed OJS 3 on my local xampp-server. The homepage looks as it should, however the admin page not:

It seems as if the content (via JS?) and the CSS is not loaded properly. The path to the CSS-files looks as follows:

http://localhost/ojs-3/index.php/index/$$$call$$$/page/page/css

I am a bit irritated by $$$call$$$.

The same happens with the JS:

<script>
	// Initialise JS handler.
	$(function() {
		$('#userTasksWrapper').pkpHandler(
			'$.pkp.controllers.UrlInDivHandler',
			{
				sourceUrl: "http:\/\/localhost\/ojs-3\/index.php\/index\/$$$call$$$\/page\/page\/tasks"
			}
		);
	});
</script>

Any help is appreciated.

Hi @Mark1,

The $$$call$$$ in the URL is intentional. What do you get when you request that CSS URL directly in the browser?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I get an empty page. No 404.

Best
Mark

Hi @Mark1,

Have you checked your PHP error log for anything relevant?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Good idea, missed that. Indeed, there are some error messages and warnings:

PHP Warning:  Declaration of PageHandler::authorize($request, &$args, $roleAssignments) should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\page\\PageHandler.inc.php on line 19, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Fatal error:  Uncaught Error: Call to a member function getByUserId() on null in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php:168\nStack trace:\n#0 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\UserRolesRequiredPolicy.inc.php(49): PKPRoleDAO->getByUserIdGroupedByContext('1')\n#1 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(196): UserRolesRequiredPolicy->effect()\n#2 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(125): AuthorizationDecisionManager->_decidePolicySet(Object(PolicySet), NULL)\n#3 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\handler\\PKPHandler.inc.php(277): AuthorizationDecisionManager->decide()\n#4 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\page\\PageHandler.inc.php(42): PKPHandler->authorize(Object(Request), Array, Array, false)\n#5 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\core\\PKPRouter.inc.php(364): PageHandler->authorize(Object(Request), Array, Array)\n#6 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\cla in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php on line 168, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of PageHandler::authorize($request, &$args, $roleAssignments) should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\page\\PageHandler.inc.php on line 19, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Fatal error:  Uncaught Error: Call to a member function getByUserId() on null in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php:168\nStack trace:\n#0 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\UserRolesRequiredPolicy.inc.php(49): PKPRoleDAO->getByUserIdGroupedByContext('1')\n#1 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(196): UserRolesRequiredPolicy->effect()\n#2 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(125): AuthorizationDecisionManager->_decidePolicySet(Object(PolicySet), NULL)\n#3 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\handler\\PKPHandler.inc.php(277): AuthorizationDecisionManager->decide()\n#4 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\page\\PageHandler.inc.php(42): PKPHandler->authorize(Object(Request), Array, Array, false)\n#5 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\core\\PKPRouter.inc.php(364): PageHandler->authorize(Object(Request), Array, Array)\n#6 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\cla in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php on line 168, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of PageHandler::authorize($request, &$args, $roleAssignments) should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\page\\PageHandler.inc.php on line 19, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Fatal error:  Uncaught Error: Call to a member function getByUserId() on null in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php:168\nStack trace:\n#0 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\UserRolesRequiredPolicy.inc.php(49): PKPRoleDAO->getByUserIdGroupedByContext('1')\n#1 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(196): UserRolesRequiredPolicy->effect()\n#2 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(125): AuthorizationDecisionManager->_decidePolicySet(Object(PolicySet), NULL)\n#3 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\handler\\PKPHandler.inc.php(277): AuthorizationDecisionManager->decide()\n#4 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\page\\PageHandler.inc.php(42): PKPHandler->authorize(Object(Request), Array, Array, false)\n#5 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\core\\PKPRouter.inc.php(364): PageHandler->authorize(Object(Request), Array, Array)\n#6 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\cla in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php on line 168, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextGridHandler::getDataElementSequence($gridDataElement) should be compatible with GridHandler::getDataElementSequence(&$gridDataElement) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php on line 0, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextGridHandler::setDataElementSequence($request, $rowId, $context, $newSequence) should be compatible with GridHandler::setDataElementSequence($request, $rowId, &$gridDataElement, $newSequence) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php on line 0, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextGridHandler::authorize($request, &$args, $roleAssignments) should be compatible with GridHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php on line 0, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextGridHandler::initialize($request) should be compatible with GridHandler::initialize($request, $args = NULL) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php on line 0, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php on line 0, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextGridHandler::initFeatures($request, $args) should be compatible with GridHandler::initFeatures($request, &$args) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php on line 0, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ValidatorUrl::getRegexp() should be compatible with ValidatorUri::getRegexp($allowedSchemes = NULL) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\validation\\ValidatorUrl.inc.php on line 19, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of ContextSiteSettingsForm::fetch($args, $request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\form\\ContextSiteSettingsForm.inc.php on line 19, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Warning:  Declaration of JournalSiteSettingsForm::execute($request) should be compatible with Form::execute($object = NULL) in C:\\xampp\\htdocs\\ojs-3\\controllers\\grid\\admin\\journal\\form\\JournalSiteSettingsForm.inc.php on line 18, referer: http://localhost/ojs-3/index.php/index/admin/contexts
PHP Fatal error:  Uncaught Error: Call to a member function getByUserId() on null in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php:168\nStack trace:\n#0 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\UserRolesRequiredPolicy.inc.php(49): PKPRoleDAO->getByUserIdGroupedByContext('1')\n#1 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(196): UserRolesRequiredPolicy->effect()\n#2 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\authorization\\AuthorizationDecisionManager.inc.php(125): AuthorizationDecisionManager->_decidePolicySet(Object(PolicySet), NULL)\n#3 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\handler\\PKPHandler.inc.php(277): AuthorizationDecisionManager->decide()\n#4 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\controllers\\grid\\GridHandler.inc.php(570): PKPHandler->authorize(Object(Request), Array, Array)\n#5 C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\controllers\\grid\\admin\\context\\ContextGridHandler.inc.php(49): GridHandler->authorize(Object(Request), Array, Array)\n#6 C:\\xa in C:\\xampp\\htdocs\\ojs-3\\lib\\pkp\\classes\\security\\PKPRoleDAO.inc.php on line 168, referer: http://localhost/ojs-3/index.php/index/admin/contexts

Hi @Mark1,

The warnings are cosmetic, and I’m not sure what’s causing the fatal errors at a glance. However, are you sure you received a confirmation message about the OJS installation completing? XAMPP users sometimes hit the default 30-second timeout during installation, and are left with a not-quite-fully-installed OJS which behaves as you describe. The timeout should also be logged. However, if you’re not sure, I’d suggest increasing the time limit, restarting your XAMPP service, and reinstalling OJS.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I set max_execution_time to 0 and max_input_time to -1 and reinstalled OJS. As with the previous installation I got a message saying that the installation has been completed successfully, however the problem remains the same.

FYI: I am using PHP 7.0.1 if this matters.

Best
Mark

Hi @Mark1,

Are you seeing PHP and CSS files created in the cache subdirectory?

In case you missed something important in the PHP error log, can you try viewing the CSS file by URL and compare the file beforehand and afterwards to see what got added?

Regards,
Alec Smecher
Public Knowledge Project Team

I have the exact same problem, and can’t figure out how to fix it. Was there every any follow-up on this @asmecher?

Hi @kallewesterling,

The conversation was left as you see it – if you’re hitting the same problem, work through the same steps and post how far you got. Armed with that, I’ll see if I can help you debug.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you @asmecher for the prompt response. I’ll try re-installing now and then I’ll get back to you!

Hi Mark1,

I had the same problem and I have resolved it.
The reason behind this is the readfile() function.

In Safemode servers, they do not allow readfile() function to execute due to some security reasons.
This readfile($cachedFile) was located at lib/pkp/controllers/page/PageHandler.inc.php

You just have to replace the function with something like:

$content=file_get_contents($cachedFile);
echo $content;

It was the only (or last) readfile function used in the whole distribution.
Good luck!

It was resolved for me just by re-installing the entire thing on the website /

I am now experiecing this problem with version 3.1.2. The CSS file located at /index.php/index/$$$call$$$/page/page/css is blank when loading the admin section. I have manually inserted it with google dev tools and it works that way. Thank you @F_Astha_Ekadiyanto for the suggestion but, that did not work for me. I do get a 200 in logs when I load the page. It’s just that the css file appears to be blank. Which file is loaded and where is it’s location? I will try to update the file on the server. Thank you.

Hi @Jeremy_Jones,

Check your PHP error log for details.

Thanks,
Alec Smecher
Public Knowledge Project Team

Thank you for the reply. Unfortunately no error are being thrown.

Hi @Jeremy_Jones,

Hmm, I would definitely expect a PHP error to be logged on your server when you get a blank page like this. Are you sure you’re checking the right log?

Thanks,
Alec Smecher
Public Knowledge Project Team

Yes. It’s a very strange situation. The page can be found but, the css file that is being loaded is blank. I’ve manually injected the css via dev tools from another instance I have set up.

Hi @Jeremy_Jones,

To debug it further, for lack of an error message, I’d suggest stepping through the PHP code that handles that request. It should be the css function in lib/pkp/controllers/page/PageHandler.inc.php. You can use error_log functions to dump information about the functions status, then watch the PHP log for that info to show up.

Regards,
Alec Smecher
Public Knowledge Project Team