Support » Plugin: WPAdverts - Classifieds Plugin » Problem with image uploader

  • Resolved thugman

    (@thugman)


    I can’t upload any image. When i select the file nothing appear. Only a # after a link. This is the firefox console error:
    Error: Syntax error, unrecognized expression: #[object HTMLDivElement] .adverts-gallery-uploads

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi, are you using the latest WPAdverts version? There used to be a bug in version 1.2.0 that generated this error but it should be fixed in 1.2.1

    I have a similar problem on my client’s site. I’m using 1.2.1
    The site is https://searenitymarine.com.au/list-boat/
    Firefox console says “TypeError: file is undefined”
    Chrome Console says:
    adverts-gallery.js?ver=6:180 Uncaught TypeError: Cannot read property ‘id’ of undefined
    at WPADVERTS.File.Uploader.FileAdded (adverts-gallery.js?ver=6:180)
    at WPADVERTS.File.Uploader.Plupload.FileAdded (adverts-gallery.js?ver=6:273)
    at a.g (jquery-1.7.2.min.js?ver=1.7.2:2)
    at Function.each (jquery-1.7.2.min.js?ver=1.7.2:2)
    at WPADVERTS.File.Uploader.Plupload.FilesAdded (adverts-gallery.js?ver=6:257)
    at g.Uploader.g (jquery-1.7.2.min.js?ver=1.7.2:2)
    at g.Uploader.dispatchEvent (plupload.min.js?ver=2.1.9:1)
    at g.Uploader.trigger (moxie.min.js?ver=1.3.5:1)
    at plupload.min.js?ver=2.1.9:1
    at moxie.min.js?ver=1.3.5:1

    Plugin Author Greg Winiarski

    (@gwin)

    Hi, your problem is a bit different, it is caused by the theme which is loading old jQuery version, you should be able to fix it by forcing WP to load the jQuery bundled with WordPress, the code below should do that

    
    function include_default_jquery() {
    	wp_deregister_script('jquery');
    	wp_enqueue_script('jquery', site_url() . '/wp-includes/js/jquery/jquery.js', array(), null, true);
    }
    add_action('wp_enqueue_scripts', 'include_default_jquery', 5000);
    

    That fixed it, thanks very much!

    Sorry for the dumb question, where do you paste this code?

    Plugin Author Greg Winiarski

    (@gwin)

    The code you can add in your theme functions.php file or even better create a new WP plugin and it the code there.

    Hey, I have the same problem with jquery version… Actually my theme is on jQuery v1.11.3 and I cant upload images. When I change jQuery version to 3.3.1 uploading is working but then whole site is not working as before…(accordions, sliders etc.)

    Is there any solution to solve this problem?

    Plugin Author Greg Winiarski

    (@gwin)

    Hi, try my code snippet from this message https://wordpress.org/support/topic/problem-with-image-uploader/#post-10018848, it will update your jQuery version to 1.12.4 which should not differ much from 1.11.3.

    Hi,
    sorry I forgot about this post, I used your code before writing my post, but it didnt help :/
    However You helped me mentioning the other version ( 1.12.4 ) and I changed the version manually. Now uploading is working.
    So thanks 🙂

    Mine is not working at all. Tried all possible ways. My requirement is to upload files from WP site front end via media uploader.

    I got the error, https://www.awesomescreenshot.com/image/3715079/0d40b3c925c1a33a204c769c66a0c6a9

    The loader is showing all time, no old images listed in the screen and can’t upload new media items too. When I tried to upload new images via this screen, i am getting the error “An error occurred in the upload. Please try again later.”

    I checked the permissions too(both upload folder permission & user role permission to upload media files)

    No errors/warning on the console.

    I called my custom jQuery files and media jquery as follows:


    add_action( 'wp_enqueue_scripts', 'LBtheme_scripts' );
    function LBtheme_scripts() {
    wp_enqueue_script( 'StripeJS1', "https://js.stripe.com/v2/" , array(), '26.10.23', true );
    wp_enqueue_script( 'mainScript', plugins_url('/js/main.js', __FILE__ ) , array(), '26.10.23', true );
    wp_enqueue_script( 'mainajax', plugins_url('/js/front-end-ajax.js', __FILE__ ) , array(), '26.10.23', true );
    wp_enqueue_media();
    }

    Anyone please help me to solve this issue? Urgent, please 🙁

    Plugin Author Greg Winiarski

    (@gwin)

    It seems like you are having a problem with the Media Library itself, not with the WPAdverts uploader, it actually does not seem like you have the WPAdverts plugin installed at all? If so then you should ask this question in the general WP forum as you will have better chances to have the problem fixed.

    Either way, does the media uploader work when you disable your custom scripts?

    Also, in your screenshot, it looks like there is some JavaScript error, while in Chrome you can click Ctrl + Shift + i it will open a developer console and will show you an actual error message if any, the error message you can copy and paste here.

    @gwin

    Yes, it is my mistake. I posted my issue in the wrong thread. Thanks for your time. Let me search a solution to my issue.

    Hi, I get a “Invalid Session. Please refresh the page and try again.” On all browsers except Mozilla, how can I fix this? I already tried to disable other addons one by one, but it did not help.

    Plugin Author Greg Winiarski

    (@gwin)

    Can you paste a link to a page where you are having this problem?

    Hi Greg,

    Sure thing, here you go: https://kid2kid.ie/adverts/

    Thank you!

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Problem with image uploader’ is closed to new replies.