Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use of undefined constant JPATH_SITE #1569

Closed
wants to merge 1 commit into from

3 participants

@bishnoi

Notice: Use of undefined constant JPATH_SITE - assumed 'JPATH_SITE' in .....\htdocs\jplateform\libraries\joomla\filesystem\path.php on line 15

emerges when testing for web application

@bishnoi bishnoi Use of undefined constant JPATH_SITE
Notice: Use of undefined constant JPATH_SITE - assumed 'JPATH_SITE' in .....\htdocs\jplateform\libraries\joomla\filesystem\path.php on line 15

emerges when testing for web application
6f64659
@elinw

See #1544. Thanks!

@LouisLandry

Actually this won't work. I mean, yes it removes the notice, but it doesn't solve the problem. In this particular code block it is looking for the constant JPATH_SITE to be equivalent to the root path of the Joomla CMS instance. Now obviously the whole shebang needs a rethink to avoid that problem, but simply setting it to be the string literal 'JPATH_SITE' is problematic because there are very likely no files at a local filesystem path JPATH_SITE.

@elinw

From the platform point of view is the application path a reasonable fall back assumption about where the root path is? I don't think that location is the location where I would expect that to be in most applications. Because it seems to me that most applications will be in folders not at root. So if it were an emergency and you had no other information at all I would normally look at least one level up. It has always seemed really strange to me that we don't have the cms frontend code in a site folder so I don't think we should standardize on that structure.

@LouisLandry

So I'm going to close this. I think we need a more complete look at this particular bit of code to find a better answer. Please feel free to re-open it if you get a more comprehensive fix put together. Thanks!

@LouisLandry LouisLandry closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 5, 2012
  1. @bishnoi

    Use of undefined constant JPATH_SITE

    bishnoi authored
    Notice: Use of undefined constant JPATH_SITE - assumed 'JPATH_SITE' in .....\htdocs\jplateform\libraries\joomla\filesystem\path.php on line 15
    
    emerges when testing for web application
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  libraries/joomla/filesystem/path.php
View
2  libraries/joomla/filesystem/path.php
@@ -12,7 +12,7 @@
if (!defined('JPATH_ROOT'))
{
// Define a string constant for the root directory of the file system in native format
- define('JPATH_ROOT', JPath::clean(JPATH_SITE));
+ define('JPATH_ROOT', JPath::clean('JPATH_SITE'));
}
/**
Something went wrong with that request. Please try again.