We are also seeing this on the admin page for creating a custom post type used in another plugin. Because the browser throws a js error other functionality on the page is not working.
CAUSE:
What is happening is that the igw.min.js script is being loaded on the page and throws an error:
Uncaught TypeError: Cannot read property ‘hasClass’ of undefined
on this line:
n = n.replace(/width=\d+/, “width=” + o.width.toString()), n = n.replace(/height=\d+/, “height=” + o.height.toString()), i.attr(“href”, n)
because a couple of lines above it is doing this:
var i = t(“.ngg-add-gallery”),
n = i.attr(“href”),
Since this is not a regular ‘Add New Post’ page there are no NextGen buttons so the element “.ngg-add-gallery” does not exist and hence ‘i’ is empty and ‘n’ is undefined, so accessing attributes of n will cause an error.
SOLUTION:
There is no reason for NextGen to be loading this script anywhere except its own custom post type pages. If NGG must load the script, then the script should test for the presence of an element with class ‘ngg-add-gallery’ before blindly trying to access properties on it (which is what is causing the error).
Hi,
I understand what you are saying but you haven’t given me a solution to implement…If I add the Editor field to the custom post type, I’m using Pods – Custom Content Types and Fields version 2.6.7 to do this, see attached screenshot https://www.dropbox.com/s/9xq1uvl3oablfke/cpt-editor-field.jpg?dl=0 I don’t get the error anymore which supports your ‘presence of an element’ but it is unnecessary to have the Editor field for the sole purpose of fixing a NextGen error.
Equally this isn’t the first time I’ve done this…using a custom post type with file uploader and using NextGen for a website…Today I’ve been updating a site un-related to my original issue I posted, Pods version 2.6.7 which didn’t need updating and NextGen which was on 2.1.50. I checked my custom post type, no errors, I could upload correctly. I then update NextGen to 2.1.56 and now the same error that I originally posted has appeared. So what ever you did between 2.1.50 and 2.1.56 now effects the presence or non-presence of ‘ngg-add-gallery’ in custom post types.
@mrnt – I have responded to the Bug Report you sent with the same information, please feel free to continue our conversation there; or, lease start your own topic so we can try to help you with your specific issue on your specific site.
See http://codex.wordpress.org/Forum_Welcome#Where_To_Post
Although continuing with the bug report you filed would likely be more effective at this time.
Thanks!
– Cais.
@weborchard – Please send us a Bug Report (https://imagely.com/report-bug/ … please reference this topic) so we can get a better look under the page at your site.
Please include as many details as you can about your site and the issue at hand so we can move on this as fast as possible.
Thanks!
– Cais.
Thanks, I’ve filed a bug report but there isn’t much more to tell other than the above.
@weborchard – Thanks! It appeared the beta release worked to resolve this issue.
– Cais.
@photocrati – Do you still want me to try the beta you’ve sent or do I wait until the update appears in Plugins?
Thanks!
@weborchard – I would say yes for the time being. We do have plans to get this release out soon but we do not have a specific timeline at the moment; and, I would suspect that it will not likely be until next week at the earliest.
Thanks!
– Cais.
@weborchard – The release noted above is on its way … it should be available within the WordPress plugin directory very soon.
Thanks!
– Cais.
@weborchard – You’re welcome!
– Cais.