Ask your WordPress questions! Pay money and get answers fast! (more info)

JS or Jquery issue with WordPress plugin. WordPress

  • SOLVED

Plugin is available in the WordPress.org directory at http://wordpress.org/plugins/bracketpress/

Installing the plugin takes a little bit of setup, so I've setup a demo at http://www.scotthack.com/bracket-contest/

When you fill out a bracket, you go through the four regions. Everything works until you get to the final four and then for some reason the final four teams do not populate into the dropdowns unless the page is refreshed.

I've created a quick video showing the issue. The video is here.

http://www.youtube.com/watch?v=BTmhv8s3Bnw&feature=youtu.be

This is time sensitive, so I'm trying to set a nice prize. Bonus for something fixed within the next hour. It is currently 7:15PM EST

Answers (1)

2014-03-19

Kyle answers:

I'm on it


Kyle comments:

Okay, the issue is that the script is on listening for the initial page load, so we need to add a second function and we can tie it to when the 4 finals drop downs are selected. We will make it identical, to the page load, but need to switch up the listeners. The only way I can test this is by editing one of the js files - do you want me to send you new copies of the file or do you want me to try on your site?

Kyle


Scott Hack comments:

Send me the new file, that way I can keep things somewhat separate so I can duplicate.


Kyle comments:

For the bracket_edit.js file in bracketpress/templates directory replace the entire file with this http://pastie.org/8952069


Scott Hack comments:

No change. Still doing it.


Kyle comments:

Can you clear your browser cache and try again. I have this setup on a test site and it fixed it here.


Scott Hack comments:

Maybe the old one was cached? Going to try some more


Kyle comments:

Yeah, that happens sometimes with JS and CSS files. Clearing your browser cache will make sure it pulls a fresh copy from your server.


Kyle comments:

Clearing it on my end, your site is working perfectly now. Tried with a fresh account just now. I think you are good to go!


Scott Hack comments:

Looks like our comments crossed. I think it was a cache issue. Testing more.


Kyle comments:

How is it coming?


Scott Hack comments:

Looking good. I sent it to 2 other people to test real quick.


Kyle comments:

Sounds good, let me know


Scott Hack comments:

Okay, in testing. This fixes a problem, but then introduces another one.

If you look at the bracket format, the teams and matches then become mis-matched.

South should be playing East, but the drop downs revert to South playing West.


Kyle comments:

Okay, so go here: http://www.bracketpress.com/wp-content/uploads/2014/03/bracketpress1.zip download and install that copy of bracketpress, then redo the change I sent earlier.


Scott Hack comments:

Okay, I'll try that, but I think that is just going to put us right back where we are now.


Kyle comments:

No the issue you were having was posted here: http://www.bracketpress.com/topic/wrong-final-4-matchups/ plus the solution I came up with earlier should get us to where we need to be.


Kyle comments:

It is working for me locally on my dev site.


Scott Hack comments:

But that is exactly the same thing we did earlier. Which fixes the boxes populating, but it is populating with the wrong teams. What team matchups do you have showing up on your local site?


Kyle comments:

You were right.

Please replace bracket_edit.js once more with this: http://pastie.org/8952918


Kyle comments:

Wait hold on


Kyle comments:

Okay, use this for bracket_edit.js in the template directory http://pastie.org/8952931

They really messed up their code, this should work though


Kyle comments:

Were you able to get that loaded?


Kyle comments:

Hey, how did it turn out?