Home Forums Plugin Support WP User Frontend Pro Insert photo and Upload file buttons not working

This topic is: resolved

This topic contains 13 replies, has 7 voices, and was last updated by  Pernes 5 years ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #19397

    Dana
    Member
    Post count: 15

    When someone tries to upload a photo or insert a file into a post, it does not work and forces page to the top. I inspected the element and it is inserting the page url with “#” as the href on the li class of both of these..

    Do not think it is my theme as it worked fine earlier. I did add Theme my login since and updated to WP 3.9.

    Any help appreciated.

    #19432

    Dana
    Member
    Post count: 15

    I have figured this one out myself.. Thanks

    #19443

    Oritro Ahmed
    Spectator
    Post count: 155

    Please share with us, how you solved it. It might help us in future to refer someone with the same problem !

    #19457

    Dan
    Member
    Post count: 5

    Please share the solution.

    I'm hitting the same issue and it's driving my client nuts. There are 5 upload fields, and all are broken. This looks like a bug in WP User Frontend Pro, as there are no javascript errors in the JS console. wp_footer() is loading scripts fine, including the uploader JS.

    I would like a fix to this issue ASAP.

    Thanks
    Dan

    #19466

    Mahi
    Member
    Post count: 1555

    Hello Dan,

    make sure they all got different meta_keys.

    Except that i can't see any other reason for not working this!

    #19467

    Dana
    Member
    Post count: 15

    My problem was that I trying to implement two forms on one page. When I deleted one of the forms all of the upload functions worked fine.

    #19484

    Oritro Ahmed
    Spectator
    Post count: 155

    Okey Dana, Thanks for the Update ๐Ÿ™‚

    #19524

    Dan
    Member
    Post count: 5

    Nope, there's only 1 form on the page, and there's no clash of meta field names. Really not happy. I shouldn't have to debug your code. If I fix it for you, I'll have to charge you for it.

    Dan

    #19527

    Mahi
    Member
    Post count: 1555

    Hello dan,

    Sorry to hear you still having trouble with upload issue. Please share your site login details in private reply to check this for you further.

    #19529

    Dan
    Member
    Post count: 5

    Hello Mahi

    I have found the bug, it's a bug with WP User Frontend Pro that you should fix. When generating the CSS ID of the form elements for the meta key, you're not making the ID of the CSS URL safe (Use this: https://codex.wordpress.org/Function_Reference/sanitize_title). That means your javascript breaks when trying to find each upload tool because there are spaces in the CSS ID, which the jQuery selector cannot cope with.

    Workaround: remove spaces from meta keys.

    However, you should be cleaning this up in code, when generating the fields.

    Regards
    Dan

    #19530

    Tareq Hasan
    Keymaster
    Post count: 2831

    Hello Dan,

    We are assuming that the meta key is without space and alphanumeric, hiphen and underscore only, thats why it's breaking. Of course it's our fault, but using the safe meta key should fix the problem for now. We'll improve on this.

    #20121

    Pernes
    Member
    Post count: 2

    Hello,

    I have the same problem with the links href=”url/#”.
    I understand a little of what the problem is but I don't understand how to fix it.

    Where and how remove spaces from meta keys ?

    Thank you.
    David.

    #20352

    nery
    Member
    Post count: 19

    Hi Pernes, I guess its not the meta keys. Head over to the other topics “Image Insert / Image Upload Problem” and download the provided Javascript File. In addition, delete the minified (min.js) version of that file from your server, to make the replaced file work.

    #20452

    Pernes
    Member
    Post count: 2

    Hello nery,

    Thank you for your answer !
    Yes, it was a problem of Javascript…

    Works fine now !

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Insert photo and Upload file buttons not working’ is closed to new replies.