Undefined URLs
-
All of my NextGEN javascript/css URLs have an undefined folder in the name. ie: http://jaminthevalley.com/wp-admin/undefined/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js
I had this issue on another site, but it seemed to have been fixed with an update. I completely upgraded this site and it’s still failing. Here’s a screenshot of all the failed javascript includes: view file
-
You can see these files failing to load here as well: http://jaminthevalley.com/lineup/.
The wordpress URL in the settings > general section is set to http://jaminthevalley.com.
@monkeypress – Your screen capture shows a missing slash in the paths which would cause these problems. A commonly occurring issue causing this to happen is an improperly defined
WP_CONTENT_URLin the wp-config.php file.Have you looked in there? If the
WP_CONTENT_URLis defined, is it as an absolute path?– Cais.
I tried setting the WP_CONTENT_URL as seen below, but it’s removing the forward slash between the domain and wp-content folder.
define( 'WP_CONTENT_URL', 'http://jaminthevalley.com/wp-content');@monkeypress – Try …
define( 'WP_CONTENT_URL', 'http://jaminthevalley.com/wp-content/');
… or simply do not define the constant at all.Is there a specific reason you need to define
WP_CONTENT_URLfor your site? This particular installation approach has been more prevalent in recent issues related to path/URL problems and I’m curious why its cropping up as much as it has been.– Cais.
I previously didn’t have that set on our site. I thought you wanted me to for testing purposes.
@monkeypress – The problem of the missing slash is the issue, typically this is due to a poorly defined
WP_CONTENT_URL… does not defining it make any difference?– Cais.
We didn’t have it defined before and were getting this issue. And then when I defined it no matter what I did I still had the same issue.
@photocrati When WP_CONTENT_URL constant is defined in wp-config.php, the paths for nextgen javascripts are referenced using the full path, but missing the slash between domain name and file path.
Without define(‘WP_CONTENT_URL’, ‘/wp-content’):
http://www.domain.com/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/gritter.min.jsWith define(‘WP_CONTENT_URL’, ‘/wp-content’):
http://www.domain.comwp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_admin/static/gritter/gritter.min.jsSince these throw
@john LeBlanc – The
WP_CONTENT_URLshould be defined as the full (absolute) URL (http://codex.ww.wp.xz.cn/Determining_Plugin_and_Content_Directories#Constants) … defining it as a relative URL will break NextGEN Gallery (at least at this time).– Cais.
@photocrati Thanks for the follow-up!
Consider using content_url() instead of relying on WP_CONTENT_URL to be set properly.
http://codex.ww.wp.xz.cn/Function_Reference/content_urlYou’ll see in source how it eliminates slash-related issues:
https://core.trac.ww.wp.xz.cn/browser/tags/4.1/src/wp-includes/link-template.php#L2798RackSpace Cloud SItes adds the relative URL in their default wp-config.php (that’s how I discovered this issue and conversation here), likely because they bundle the “Root Relative URLs” plugin with their default WP install. Root Relative had an issue, which is likely why the RackSpace failed to use the full URL: https://ww.wp.xz.cn/support/topic/root-relative-uris
RackSpace Cloud Sites compatibility isn’t the motivation for my post here, however. I think content_url() is a safer way for you to build your paths to scripts (it’s filterable).
@john LeBlanc – Thanks for the follow-up. I simply could not, and still do not, understand why anyone would purposely write that definition incorrectly. I find it really surprising that it would be “RackSpace Cloud Sites” … although I have seen similar reports from other hosting services as well.
Still, this is very good information … thanks for sharing!
– Cais.
I just dug into this one more since it’s happening on another site. If I check out the /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/mvc/adapter.mvc_router.php file I can see that the join_paths call is what seems to be breaking the URL. I’m not sure why, but it’s removing the starting forward slash on the get_base_url call, which is breaking all of the baths.
I can tack a forward slash on here if one doesn’t exist and suddenly everything works again.
@monkeypress – Thanks for the follow-up and the investigation. This is not a widespread specific issue as it does not occur everywhere so something must be creating this problem either in your server environment, site settings, or another piece of code affecting paths.
If you have modified the plugin’s core code it will be over-written with the next update. You might also consider testing our latest public beta found here: http://nextgen-gallery.com/nextgen-gallery-latest-beta/
Thanks!
– Cais.
The topic ‘Undefined URLs’ is closed to new replies.