Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path issue on Windows #536

Open
Yiannistaos opened this issue Feb 10, 2021 · 6 comments
Open

Path issue on Windows #536

Yiannistaos opened this issue Feb 10, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@Yiannistaos
Copy link

Machine

  • PHP 7.4
  • Joomla! 3.9.24
  • Windows 10
  • Laragon (Apache)

Steps to reproduce the behavior

  1. Download the latest release package: com_pages_v0.19.5.zip https://github.com/joomlatools/joomlatools-pages/releases/download/v0.19.5/com_pages_v0.19.5.zip
  2. Upload the package using the Joomla installer.
  3. I've created the file C:\laragon\www\joomla\joomlatools-pages\pages\en\hi.html
  4. I've visited the URL http://joomla.test/en/hi
  5. I've got the error below.

It seems that something goes wrong with the first slash in front of C:\ => "/C:\laragon".
Please, see the error below.

Result

`
RuntimeException: 'The page registry cache path "/C:\laragon\www\joomla/joomlatools-pages/cache/pages" does not exist' thrown in C:\laragon\www\joomla\components\com_pages\page\registry.php on line 550

while handling exception

RuntimeException: 'The page registry cache path "/C:\laragon\www\joomla/joomlatools-pages/cache/pages" does not exist' thrown in C:\laragon\www\joomla\components\com_pages\page\registry.php on line 550

Stacktrace
#0 C:\laragon\www\joomla\components\com_pages\page\registry.php(526): ComPagesPageRegistry->storeCache('/C:\laragon\www...', Array)
#1 C:\laragon\www\joomla\components\com_pages\page\registry.php(33): ComPagesPageRegistry->loadCache('/C:\laragon\www...', false)
#2 C:\laragon\www\joomla\libraries\joomlatools\library\object\manager\manager.php(723): ComPagesPageRegistry->__construct(Object(KObjectConfig))
#3 C:\laragon\www\joomla\libraries\joomlatools\library\object\manager\manager.php(161): KObjectManager->_instantiate(Object(KObjectIdentifier), Object(KObjectConfig))
#4 C:\laragon\www\joomla\libraries\joomlatools\library\object\object.php(290): KObjectManager->getObject(Object(KObjectIdentifier), Array)
#5 C:\laragon\www\joomla\components\com_pages\dispatcher\router\pages.php(16): KObject->getObject('page.registry')
#6 C:\laragon\www\joomla\libraries\joomlatools\library\object\object.php(73): ComPagesDispatcherRouterPages->_initialize(Object(KObjectConfig))
#7 C:\laragon\www\joomla\components\com_pages\dispatcher\router\abstract.php(42): KObject->__construct(Object(KObjectConfig))
#8 C:\laragon\www\joomla\libraries\joomlatools\library\object\manager\manager.php(723): ComPagesDispatcherRouterAbstract->__construct(Object(KObjectConfig))
#9 C:\laragon\www\joomla\libraries\joomlatools\library\object\manager\manager.php(161): KObjectManager->_instantiate(Object(KObjectIdentifier), Object(KObjectConfig))
`

@johanjanssens johanjanssens added the bug Something isn't working label Feb 10, 2021
@johanjanssens johanjanssens self-assigned this Feb 10, 2021
@johanjanssens johanjanssens changed the title Error slash on Windows 10, "/C:\laragon\www\joomla/joomlatools-pages/cache/pages" Path issue on Windows Feb 10, 2021
@johanjanssens
Copy link
Member

johanjanssens commented Feb 10, 2021

@Yiannistaos Thanks for the report. Seen this specific issue before, it's a Windows path problem related to your server setup.

I'm afraid I do not have a Windows machine at my disposal to test and fix this issue, so will need your help a bit. Can you please do the following:

  1. Open up /index.phpfile for editing and add the following code
var_dump($_SERVER['DOCUMENT_ROOT']);
echo '<br />';
var_dump(JPATH_ROOT);
echo '<br />';
var_dump(Koowa::getInstance()->getRootPath());
echo '<br />';
var_dump( KObjectManager::getInstance()->getObject('com://site/pages.config')->getSitePath('cache'));

below the last line of code:

// Execute the application.
$app->execute(); 

The result would be

....

// Execute the application.
$app->execute();

var_dump($_SERVER['DOCUMENT_ROOT']);
echo '<br />';
var_dump(JPATH_ROOT);
echo '<br />';
var_dump(Koowa::getInstance()->getRootPath());
echo '<br />';
var_dump( KObjectManager::getInstance()->getObject('com://site/pages.config')->getSitePath('cache'));

Then go to your home page and you should get 4 lines rendered at the bottom of the page as so:

Screenshot 2021-02-10 at 14 56 47

Please provide me those 4 lines, this gives me an idea about your paths and what could be wrong.

@Yiannistaos
Copy link
Author

Yiannistaos commented Feb 10, 2021

@johanjanssens

With the "System - Joomlatools Framework" plugin enable it doesn't display anything after $app->execute();, only the error I've mentioned in the previous message.

RuntimeException: 'The page registry cache path "/C:\laragon\www\joomla/joomlatools-pages/cache/pages" does not exist' thrown in C:\laragon\www\joomla\components\com_pages\page\registry.php on line 550

while handling exception

RuntimeException: 'The page registry cache path "/C:\laragon\www\joomla/joomlatools-pages/cache/pages" does not exist' thrown in C:\laragon\www\joomla\components\com_pages\page\registry.php on line 550

I've disable the plugin "System - Joomlatools Framework" and I've added the below code in the index.php file.
You can see the paths at the comments on the right side of each line.

// Execute the application.
$app->execute();

$path = JPATH_LIBRARIES.'/joomlatools/library/koowa.php';
require_once $path;
var_dump($_SERVER['DOCUMENT_ROOT']); // string(22) "C:/laragon/www/joomla/"
var_dump(JPATH_ROOT); // string(21) "C:\laragon\www\joomla"
var_dump(Koowa::getInstance()->getRootPath()); // string(21) "C:\laragon\www\joomla"
# var_dump( KObjectManager::getInstance()->getObject('com://site/pages.config')->getSitePath('cache')); // ERROR: 0 Cannot load object from identifier: com://site/pages.config

@Bodge-IT
Copy link

Bodge-IT commented Feb 11, 2021

@johanjanssens "Seen this specific issue before, it's a Windows path problem related to your server setup."
I have this too, on my standard windows 7 client and XAMPP. I gave up trying to get it to work and moved to an online setup as the location of the finished result would end up online anyway.

@johanjanssens
Copy link
Member

@Bodge-IT @Yiannistaos I still don't have access to a Windows system, so a bit hard for me to work on this bug. Would love to get this one out of the way though.

Re-reading the initial report. It seems that pages cannot create the cache path and then errors out, which is to be expected. This could be a problem with the path, which was my initial hunch, or a problem with the folder permissions.

Can you try to following, add the cache path manually and see if that gets you past the error, you need to manually create this folder: /joomlatools-pages/cache

@manojLondhe
Copy link
Contributor

manojLondhe commented Jun 7, 2021 via email

@esedic
Copy link

esedic commented Jun 7, 2021

This my error log from Windows machine:

RuntimeException: 'The template cache path "/C:\laragon\www\joomla3/joomlatools-pages/cache/templates" does not exist' thrown in C:\laragon\www\joomla3\libraries\joomlatools\library\template\engine\abstract.php on line 143

while handling exception

RuntimeException: 'The page registry cache path "/C:\laragon\www\joomla3/joomlatools-pages/cache" does not exist' thrown in C:\laragon\www\joomla3\libraries\joomlatools-components\pages\page\registry.php on line 590

Stacktrace
#0 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\page\registry.php(566): ComPagesPageRegistry->storeCache('/C:\laragon\www...', Array)
#1 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\page\registry.php(33): ComPagesPageRegistry->loadCache('/C:\laragon\www...', false)
#2 C:\laragon\www\joomla3\libraries\joomlatools\library\object\manager\manager.php(723): ComPagesPageRegistry->__construct(Object(KObjectConfig))
#3 C:\laragon\www\joomla3\libraries\joomlatools\library\object\manager\manager.php(161): KObjectManager->_instantiate(Object(KObjectIdentifier), Object(KObjectConfig))
#4 C:\laragon\www\joomla3\libraries\joomlatools\library\object\object.php(290): KObjectManager->getObject(Object(KObjectIdentifier), Array)
#5 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\dispatcher\router\router.php(16): KObject->getObject('page.registry')
#6 C:\laragon\www\joomla3\libraries\joomlatools\library\object\object.php(73): ComPagesDispatcherRouter->_initialize(Object(KObjectConfig))
#7 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\dispatcher\router\abstract.php(42): KObject->__construct(Object(KObjectConfig))
#8 C:\laragon\www\joomla3\libraries\joomlatools\library\object\manager\manager.php(723): ComPagesDispatcherRouterAbstract->__construct(Object(KObjectConfig))
#9 C:\laragon\www\joomla3\libraries\joomlatools\library\object\manager\manager.php(161): KObjectManager->_instantiate(Object(KObjectIdentifier), Object(KObjectConfig))
#10 C:\laragon\www\joomla3\libraries\joomlatools\library\object\object.php(290): KObjectManager->getObject(Object(KObjectIdentifier), Array)
#11 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\dispatcher\router\factory.php(75): KObject->getObject('com:pages.dispa...', Array)
#12 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\dispatcher\http.php(90): ComPagesDispatcherRouterFactory->resolve('pages:/', Array)
#13 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\event\subscriber\dispatcher.php(169): ComPagesDispatcherHttp->getRoute()
#14 C:\laragon\www\joomla3\libraries\joomlatools-components\pages\event\subscriber\dispatcher.php(44): ComPagesEventSubscriberDispatcher->isDispatchable()
#15 C:\laragon\www\joomla3\libraries\joomlatools\library\event\publisher\abstract.php(128): ComPagesEventSubscriberDispatcher->onAfterApplicationInitialise(Object(KEvent), Object(ComKoowaEventPublisher))
#16 C:\laragon\www\joomla3\libraries\joomlatools\component\koowa\event\publisher\publisher.php(55): KEventPublisherAbstract->publishEvent(Object(KEvent), Array, Object(Joomla\CMS\Application\SiteApplication))
#17 C:\laragon\www\joomla3\plugins\system\joomlatools\joomlatools.php(287): ComKoowaEventPublisher->publishEvent('onAfterApplicat...', Array, Object(Joomla\CMS\Application\SiteApplication))
#18 C:\laragon\www\joomla3\plugins\system\joomlatools\joomlatools.php(202): PlgSystemJoomlatools->_proxyEvent('onAfterApplicat...')
#19 C:\laragon\www\joomla3\libraries\joomla\event\event.php(70): PlgSystemJoomlatools->onAfterInitialise()
#20 C:\laragon\www\joomla3\libraries\joomla\event\dispatcher.php(160): JEvent->update(Array)
#21 C:\laragon\www\joomla3\libraries\src\Application\BaseApplication.php(108): JEventDispatcher->trigger('onafterinitiali...', Array)
#22 C:\laragon\www\joomla3\libraries\src\Application\CMSApplication.php(674): Joomla\CMS\Application\BaseApplication->triggerEvent('onAfterInitiali...')
#23 C:\laragon\www\joomla3\libraries\src\Application\SiteApplication.php(686): Joomla\CMS\Application\CMSApplication->initialiseApp(Array)
#24 C:\laragon\www\joomla3\libraries\src\Application\SiteApplication.php(212): Joomla\CMS\Application\SiteApplication->initialiseApp()
#25 C:\laragon\www\joomla3\libraries\src\Application\CMSApplication.php(203): Joomla\CMS\Application\SiteApplication->doExecute()
#26 C:\laragon\www\joomla3\index.php(49): Joomla\CMS\Application\CMSApplication->execute()
#27 {main}

I've noticed additional slash in the beginning of the path: /C:\laragon\www\joomla3/joomlatools-pages/cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants