Puck,
thanks for the report and thank you for your efforts to find a solution!
I will investigate this. Please, tell which browser you have used (browser and OS version). I have tried it so far with Firefox 4.0.1 and Safari 5.0.4 both on a computer with Win 7. But Auto Detect did not prepend a whitespace.
But I will do some more tests.
Regards,
Tim
Thread Starter
Puck
(@puck)
Google Chrome 12.0.742.91 on Windows 7/64 bit.
I hadn’t thought about trying other browsers…
Firefox 4: Yes, no space!
IE 9: No space.
So it’s definitely a Chrome problem.
Thanks a lot for making these additional tests!
It is probably a problem of the podPress code which appears in Chrome. I will try to find a solution. That is nothing that should last.
Regards,
Tim
Puck,
please, try the current Development Version. I have added at several lines of the code trim commands which should definitely prevent “Auto Detect” from delivering values with prepended (or appended) white-spaces.
Notice: This is a Beta version. Please, make a backup of your db before you try it.
Regards,
Tim
Thread Starter
Puck
(@puck)
Grabbed it, backed up my release version, installed Development Version.
Cleared browser cache, loaded the latest podcast, cleared the “Duration” field and clicked “Auto Detect”. Space still occurs in Chrome.
Puck,
I have also made some more tests with Chrome 12.0.742.100 on Win 7 64bit and Chromium 12.0.742.91 (87961) Ubuntu 11.04 (64 bit) in a blog on a Linux server and a Windows server. But so far I was not able reproduce this strange behaviour. That is why I still have problems to imagine where the whitespace comes from.
With the last modifications the result of the duration retrieval gets trimmed (ltrim, rtrim) before it gets inserted.
The javascript function which recieves the value as a response of a AJAX request replaces all characters with this (trimmed) result. It should be not relevant whether there is something in this input field or not. (Can you confirm that?)
So it should work.
However I have made some further modifications which are now part of the Development Version. I would appreciate it if you could download and install this version.
If the problem still occurs after the upgrade then you could activate a debug log function in podPress. In oder to do that you need to edit the podpress.php file. In line 127 of that file you can find
if ( ! defined( 'PODPRESS_DEBUG_LOG' ) ) { define( 'PODPRESS_DEBUG_LOG', FALSE ); }
change it to
if ( ! defined( 'PODPRESS_DEBUG_LOG' ) ) { define( 'PODPRESS_DEBUG_LOG', TRUE ); }
If you do that, podPress will try to create a log file (podpress_log.dat) in the podpress folder. For this action the podpress script needs the permission to write in this folder (That is not always the default server setting.).
podPress logs all its steps during these Auto Detect actions and other actions. So activate this only for one or two clicks on such a Auto Detect button.
Maybe post the content of this log file. (Maybe you should consider using a pastebin service. Or make screenshot of the content of the file.)
But mostly I want to know whether this file contains a line like podPress_getDuration - playtime_string: 0:00:01
and how many whitespaces are between playtime_string:
and the duration value.
Is the duration value in this file equal to the result which you could see in the input field next to the Auto Detect button?
Are you using any Chrome browser extensions?
Tim
Thread Starter
Puck
(@puck)
The new Developer Version works! No more space!
Thank you! Best and fastest plugin developer response ever!
And for the record, I did a test before trying the new Dev version, disabling my Extensions, clearing the cache, and testing in an Incognito window and the space still showed up.
Also of note was that the space also appeared in “File Size” but was trimmed after Publishing/Updating the post. Duration returned empty if it was Published/Updated with the space at the beginning.
Next payday you’re getting a donation from Caustic Soda for sure!
That are really good news!
Thank you for your good and thorough descriptions and for all the tests.
I will review the part of the plugin which stores the post settings in the db.
Regards,
Tim
(ps: I have no donation button. But thanks for the offer.)
Thread Starter
Puck
(@puck)
This isn’t you? There’s a donate button there.
No. That is the site of the original author of podPress Dan Kuykendall (seek3r). You may donate on his site. I did not wanted to stop you from doing that.
Maybe it will bring Dan back to get involved again. Furthermore it is totally right to give him credit. He has written and maintained (until 2008) the plugin.
I have started to write patches for podPress more than a year ago since it started to become incompatible with WP (e.g. jam the media upload dialog of the WP post editor; problems with the Widget API; Multi Site incompatibilities etc.) and since last summer I have started to add new features too.