Improved Attachment Error Handling

Started by Kays, December 20, 2011, 01:53:07 PM

Previous topic - Next topic

Kays

Link to Mod

This mod changes the method used when there is an error in uploading an attachment. Currently, when there is an error, the procedure is stopped and you are redirected back to the post page to correct the problem. With the mod installed, any attachment errors are now all displayed on a separate page after all files have been uploaded and the post is created. Any files with an error are deleted from the server and not added to the database.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods


samurai-lupin

Hello, this looks like a great mod! Could you please also do a version for SMF 1.1 ? Thank you

samurai-lupin

Helllo Kays, I really hope you woll consider doing a SMF 1.1 Version of this great mod. I have been looking for such a mod for a long time. Thanks!

Kays

Sorry, but I don't intend to backport it to SMF 1.x.

And, you're welcome Bancherd. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

samurai-lupin

Oh! It would be really great to have this mod available for SMF 1.1 ... maybe you could change your mind please?

Kays

Sorry, but it's a bit of a massive mod with the changes made and I'm just not into backporting it.

Why don't you consider upgrading to 2.0 instead. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

samurai-lupin

Quote from: Kays on January 04, 2012, 11:01:12 PM
Sorry, but it's a bit of a massive mod with the changes made and I'm just not into backporting it.

Why don't you consider upgrading to 2.0 instead. :)

Because I have a highly customized board.

GL700Wing

#8
This mod is a great idea but it contains two minor bugs that generate LOTS of messages in the error log every time there is a problem with uploading an attachment (see Unable to load language file...)

Attached is a mod file containing the fixes.

Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

littlenicki

Hello GL700Wing, would your dare doing a SMF 1.1 compatible version of this mod please? Would be great! Thank you!
Fomer SMF user. Switched to Invision Power Board and VBulletin

Kays

HI GL700Wing, thanks for that.

However, rather than posting a revised mod. Could you please post the changes made.

Thanks. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

FrizzleFried

Quote from: Kays on June 05, 2013, 01:21:50 PM
HI GL700Wing, thanks for that.

However, rather than posting a revised mod. Could you please post the changes made.

Thanks. :)

Agreed... I'd love to see the changes made!

Thanks!

GL700Wing

Quote from: Kays on June 05, 2013, 01:21:50 PM
HI GL700Wing, thanks for that.
However, rather than posting a revised mod. Could you please post the changes made.
You're welcome - and sure!

Both errors/fixes are in ./Sources/Post.php

Find
if (!empty($attachmentOptions['errors']))
{
if (!isset($txt['file_too_big']))
loadLanguage('errors');


Replace with
if (!empty($attachmentOptions['errors']))
{
if (!isset($txt['file_too_big']))
loadLanguage('Errors');


Find
loadTemplate('Errors');
$context['sub_template'] = 'attachment_errors';
checkSubmitOnce();


Replace with
loadTemplate('Errors');
$context['sub_template'] = 'attachment_errors';
checkSubmitOnce('free');
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Quote from: littlenicki on June 05, 2013, 11:05:52 AM
Hello GL700Wing, would your dare doing a SMF 1.1 compatible version of this mod please? Would be great! Thank you!
I don't have the skills for this - you'll have to ask the mod owner.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Kays

The file on the mod site has been updated and as well as the version number.

Again, thanks GL700Wing. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

littlenicki

Hello Kay, how about a SMF 1.1 compatible version please? Thank you!
Fomer SMF user. Switched to Invision Power Board and VBulletin

Kays

Quote from: Kays on January 04, 2012, 11:01:12 PM
Sorry, but it's a bit of a massive mod with the changes made and I'm just not into backporting it.

Why don't you consider upgrading to 2.0 instead. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

TomW

Very nice, thanks for making this mod, Kays.  This really should be in the core.

Kays

Thanks Tom, it has been included in 2.1 already. ;)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: