Hanging on save screen with html 5 version
-
Hey, I can’t seem to get the html 5 version to work on my site, it hangs on the saving screen and nothing gets saved. I’m using WordPress 4.3. Any ideas? The Flash version works but I’d prefer the html 5 one! Thanks
-
Hey Jimme,
I had the same problem several weeks ago. It turned out to be a http/https problem. It was fairly easy to fix that. Could you send me the url to your site first?
I’ll look into it and get back to you.Ah yes that might well be the issue as i’m using https. I’ve set up a test page with dooodl on it:
https://www.theopenschool.co.uk/test/
That would be great if you can take a look. I’m planning to play around with it a bit so that only registered users can create drawings and when they save them they are saved along with the user id so that they can then be called on to users profile pages in a ‘my drawings’ section.
Best, Jim
Yes, you are in fact having the same problem as I was.
The problem is that javascript does not allow communication between different protocols (or domains) for security reason.
The fix would be te replace the script urls in Dooodl to refer to the protocol-less url.
Meaning that `https://mysite.com/wp/wp-content/…/saveNew.php’ would be replaced by ‘//mysite.com/wp/wp-content/…/saveNew.php’. That way the browser uses the same protocol to load the file as the protocol used to load the page.
If you could send me some FTP login details, I can go into the WP folder and fix the doodl plugin for you. You can email those credentials to ‘[email protected]’. (Those can be temporary details which can be removed later on).
Hey, i replied to the email wordpress sent me thinking it would update here but doesn’t seem to work like that so here’s my reply incase you didn’t get it:
Thanks, im happy to change the paths myself if you know where they (or ‘it’ if its only defined once) are. Might help others looking for same solution then! I really like the plugin by the way and very unique.
Is it this path in dooodl/v2/creator/index.php:
$saver = WP_PLUGIN_URL.’/’.$file . “save.php”;
Does that need changing?
Hey,
You are 100% correct: other people might in fact find this helpful.
The reason I suggested looking into your code is because I’m not certain on how many places I had to change it. (also the code is a mess, so I prefer people not going in there :p It might hurt their eyes :p )If I remember correctly, all I did was change the following file:
<WP site>/wp-content/plugins/dooodl/v2/creator/index.phpon the top of the file it says this:
$saver = WP_PLUGIN_URL.'/'.$file . "save.php";
Right below it I added this:
$saver = str_replace('https://', 'https://', $saver);
This will only work on sites where there is HTTPS only. I will change this soon so this is no longer necessary (i’m swamped with work, so for those of you waiting for the update, please hang in there. A lot of work has already been done on the rewrite but there’s stil a lot of debugging required).
Perfect that works, thanks! I found this thread:
https://codex.www.ads-software.com/Determining_Plugin_and_Content_Directories
And the linked article:
https://codex.www.ads-software.com/Determining_Plugin_and_Content_Directories
Which might help ironing out the need for the extra line of code in future versions!
I’ll let you know how I get on trying to save a user id as a reference with the image, would be cool for me to then be able to show a users ‘dooodles’ on their profile page. Basically i’m gonna try and change the page that appear after clicking save to just auto fill the user name and save the description field as the user id… something like that so that i can pull the dooodls by user id.
In the most recent (dev-)version of the plugin, this problem has already been solved. Thanks! ??
I see, you’re trying to build a bit of a community system where people have their own Dooodls. This could totally work. Let me know if you’re having trouble getting it to work. I do advise against using SQL statements in your work (unless 100% necessary). The plugin should soon be updated in the repo and all the sql and custom table stuff will go away. i would hate that that would destroy your work as well.
(I repeat: the code inside Dooodl is horrible! It was written as one of my first plugins in the hopes to make it work. Today, I’m a professional WP developer and I know very well how wrong all of that code back then was :p ). So don’t get too inspired by the internals there ??
Well i’m just doing a quick hack to get it working how i want then i’ll revisit it when you update. So far i’ve changed a couple of lines in save.php to look like:
global $current_user; if($username == ""){ $username = $current_user->user_login; } if($url == ""){ $url = $current_user->ID; }
This pushes the username in to the name field and the id in to the url. Then i’m just gonna hide all the fields except the title… and maybe the description from the front end. My site’s for kids that’s why i’m trying to make it as easy as possibe for them!
Why do you advise against using SQL queries? I’ve got a few functions ive written to pull data out of the database using this… is it a security risk? can you point me in the direction of best practice to get database information in a different way?
For example now that i’m saving the dooodls in the database with the user id in the url field i was going to write a function that would query the database with an sql select from where type statement and return a users doodls, is this not the best way to achieve this?!
I’m just learning really so any advice would be much appreciated!
I just released V2 of this plugin. Let me know if you’re still having problems with HTTPS after the release. I’ll close this ticket for now.
I’ll look into connecting users with Dooodls sometime soon ??
- The topic ‘Hanging on save screen with html 5 version’ is closed to new replies.