• Resolved weborchard

    (@weborchard)


    Hi,
    I’ve noticed this on a couple of websites I’ve developed, both with the latest NextGen plugin and both site’s custom post type file upload field unable to work now. The error pertains to this path ‘/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/attach_to_post/static/igw.min.js’ The error appears within the web inspector when inside the cpt to add a new post. If I de-activate NextGen, return no errors appear, I can upload a file with the Plupload file uploader. If I re-activate the plugin, return, the error comes back and I am unable to use the file upload field inside the cpt.

Viewing 12 replies - 1 through 12 (of 12 total)
  • 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).

    Thread Starter weborchard

    (@weborchard)

    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.

    Plugin Contributor photocrati

    (@photocrati)

    @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.

    Plugin Contributor photocrati

    (@photocrati)

    @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.

    Thread Starter weborchard

    (@weborchard)

    Thanks, I’ve filed a bug report but there isn’t much more to tell other than the above.

    Plugin Contributor photocrati

    (@photocrati)

    @weborchard – Thanks! It appeared the beta release worked to resolve this issue.

    – Cais.

    Thread Starter weborchard

    (@weborchard)

    @photocrati – Do you still want me to try the beta you’ve sent or do I wait until the update appears in Plugins?

    Thanks!

    Plugin Contributor photocrati

    (@photocrati)

    @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.

    Thread Starter weborchard

    (@weborchard)

    Ok thanks

    Plugin Contributor photocrati

    (@photocrati)

    @weborchard – The release noted above is on its way … it should be available within the WordPress plugin directory very soon.

    Thanks!

    – Cais.

    Thread Starter weborchard

    (@weborchard)

    Thanks for the update

    Plugin Contributor photocrati

    (@photocrati)

    @weborchard – You’re welcome!

    – Cais.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘TypeError: undefined is not an object (evaluating ‘n.replace’)’ is closed to new replies.