@bakke – Have you tried our latest beta version? See this page for more details: http://www.nextgen-gallery.com/nextgen-gallery-latest-beta/
– Cais.
Thread Starter
Bakke
(@bakke)
Yes, I have tried 2.0.55, as well as the “stable” 2.0.40.
giving WordPress its own directory is not supported at all. This is due to wrong use of the ABSPATH constant (this is used to determine the document root in the plugin, while it actually gives you the location of WordPress, which is not always document root).
My WordPress-installation is setup like this:
/path/to/page/wordpress/ – Standard WordPress-installation. No themes or plugins live here.
/path/to/site/content/ – This is where i keep my themes, plugins and uploads.
Just as described here.
NextGen Gallery will go looking for files inside /path/to/page/wordpress/ – because it uses ABSPATH. While it should be looking inside /path/to/site/content/.
Instead of using ABSPATH as a base for finding files, you should be using constants like WP_CONTENT_DIR, WP_PLUGINS_DIR and functions like plugin_dir_path(). That is the correct way, and would solve this problem.
Giving WordPress its own directory is becoming more and more popular, and is considered a best practice by many. Supporting this should be a priority.
Same here, my WordPress has its own dir, I’m getting the same errors.
Did you find a workaround?
More specifically, my install is:
wp-testing/wordpress
wp-testing/wp-content/plugins/nextgen-gallery
where wp-testing/wp-config.php starts with:
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/wordpress');
define('WP_CONTENT_DIR', realpath($_SERVER['DOCUMENT_ROOT'] . '/wp-content'));
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/wp-content');
Editing nextgen-gallery/products/photocrati_nextgen/modules/fs/class.fs.php fixes the MVC error:
class C_Fs extends C_Component {
[...]
function initialize()
{
parent::initialize();
$this->_document_root = $this->set_document_root(WP_CONTENT_DIR);
}
but the path to all internal NextGen CSS/JS files is still incorrect, so there must be another location in NextGen where the plugin path is not computed from the WordPress constants. Actually it seems that ABSPATH is used in many many files, so this is going to be tricky 🙁