News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Post and PM Inline Attachments

Started by dougiefresh, July 26, 2014, 09:14:08 PM

Previous topic - Next topic

GL700Wing

Quote from: Sebastiii on May 06, 2022, 11:18:11 AM
Quote from: @rjen on December 30, 2017, 12:46:45 PMInstalling version 6.2 on my test site results in HTTP ERROR 500
Hi,
Did you know/remember what happen for this error ?
Thanks.
Please try using the latest version of the mod.
Life doesn't have to be perfect to be wonderful ...

Sebastiii

Quote from: GL700Wing on May 06, 2022, 05:42:20 PMPlease try using the latest version of the mod.
Hello, what do you mean by using the latest version ?
Effectively, I wasn't enough clearly in my bug report :(
I'm using 2.0.19 SMF version and 7.06 (Post_and_PM_Inline_Attachments_v7.06.zip) version.

And I'm getting HTTP ERROR 500 on the online production but not in my local copy of SMF to test plugins before installing it online.

Thanks.

GL700Wing

Quote from: Sebastiii on May 07, 2022, 03:56:12 AMHello, what do you mean by using the latest version ?
Effectively, I wasn't enough clearly in my bug report :(
In your previous message you stated you were installing version 6.2 ...

QuoteI'm using 2.0.19 SMF version and 7.06 (Post_and_PM_Inline_Attachments_v7.06.zip) version.

And I'm getting HTTP ERROR 500 on the online production but not in my local copy of SMF to test plugins before installing it online.
Ok - please download and install version 7.05 and let me know if you have the same issue with that version.

PS: I'm currently away from home and won't have access to my test system until Tuesday or Wednesday next week ...
Life doesn't have to be perfect to be wonderful ...

GL700Wing

Quote from: Sebastiii on May 07, 2022, 03:56:12 AMHello, what do you mean by using the latest version ?
Effectively, I wasn't enough clearly in my bug report :(
In your previous message I thought you were also installing version 6.2 ...

That version was released before I was involved in updating this mod so I don't know what the cause and/or fix were ...

QuoteI'm using 2.0.19 SMF version and 7.06 (Post_and_PM_Inline_Attachments_v7.06.zip) version.

And I'm getting HTTP ERROR 500 on the online production but not in my local copy of SMF to test plugins before installing it online.
Ok - please download and install version 7.05 and let me know if you have the same issue with that version.

PS: I'm currently away from home and won't have access to my test system until Tuesday or Wednesday next week ...
Life doesn't have to be perfect to be wonderful ...

Sebastiii

Quote from: GL700Wing on May 07, 2022, 04:40:41 AMIn your previous message you stated you were installing version 6.2 ...
Ok, I see, I was quoting an older message with the same issue and the version was 6.2 in this quote.
Sorry for this :)

QuoteOk - please download and install version 7.05 and let me know if you have the same issue with that version.

PS: I'm currently away from home and won't have access to my test system until Tuesday or Wednesday next week ...
Ok I will try it and report back need to have correct backup and I will do it.
It looks like kind of permission issue maybe, because locally, I'm using the same DB and forum folder files (but local is windows with WAMP with same PHP version).

Sebastiii

Quote from: GL700Wing on May 07, 2022, 04:43:01 AMOk - please download and install version 7.05 and let me know if you have the same issue with that version.
Same and even worst, because even if I remove "Subs-InlineAttachments.php" the HTTP ERROR 500 is always present now.
No clue where is this issue !
Thanks.

Sebastiii

@GL700Wing
With 7.05, the forum is back if I:
1- Rename the file "Subs-InlineAttachments.php" to whatever "Subs-InlineAttachments.php.broken" for ex.
2- Restore "Subs.php" the one before installing the plugin.

But with the "Subs.php" restored and if I rename back "Subs-InlineAttachments.php.broken" to "Subs-InlineAttachments.php", the HTTP 500 ERROR is back again.

With 7.06, just renaming "Subs-InlineAttachments.php" to "Subs-InlineAttachments.php.broken" is enough to get rid of the HTTP 500 ERROR, but the plugin doesn't work, and it's logic :D

So looking in the "Subs.php" from 7.05 and it calls the "function ILA_Setup($msg_id, &$message)...." where it does differently in 7.06

7.06 :
Quote// Post and PM Inline Attachments mod.
    global $sourcedir;
    if (file_exists($sourcedir . '/Subs-InlineAttachments.php'))
        ILA_Setup($cache_id, $message);

7.05 :
Quote// Post and PM Inline Attachments mod.
    ILA_Setup($cache_id, $message);

So, it can explain why in 7.06 renaming the file maybe back the forum online again ;)
The part of the issue seems to be in "ILA_Setup" code from "/Subs-InlineAttachments.php".

Now why ? :)

Let's see if we can figure out when you will be back :)

PS : I have duplicated the online forum into another directory and with a copy of the DB, like this I can try online without broken the current working SMF forum :)


Sebastiii

Ok, figure out what line makes the error (based on 7.05) :
In 'function ILA_Post_Attachments($msg_id)' from ".\Subs-InlineAttachments.php"
When I comment those 2 lines (need to be both line):

Quote//$context['ila']['id_member'][$msg_id] = $row['id_member'] ?? '0';
//$msg_board = (int) ($row['id_board'] ?? '0');

Forum is back online (no ERROR 500).
Maybe there is a syntax that is not correct ?
No clue to check that by debugging but it's related to those line and I don't know if you request is elsewhere (surely not) because the forum didn't show up HTTP ERROR 500.

I will try on 7.06, but I'm pretty sure it will be the same result.

Edit : Installing 7.06 and commented out those 2 above lines and forum is back.
There is to do with syntax it seems, maybe related to PHP settings somehow.

Arantor

What version of PHP are you using?

Sebastiii

Quote from: Arantor on May 07, 2022, 06:17:19 AMWhat version of PHP are you using?
I'm using 5.6 version, maybe I should change to a more recent one ?
I wouldn't break my forum but upgrading it.

Arantor

The ?? syntax doesn't exist in PHP 5.6 which is why you get the errors you do, and PHP 5.6 is years out of date at this point. (PHP team is working on releasing 8.2 this year.)

SMF 2.0 series is good up to PHP 7.4, your mods may not be though.

Sebastiii

@Arantor
I will set it to PHP 7.4 then, and it will fix this issue for sure.
Will report back.
Thanks :)

Sebastiii

@Arantor @GL700Wing
It works, :) So it was related to the syntax not compatible with 5.6 like you said.
Thanks.

GL700Wing

Quote from: Arantor on May 07, 2022, 07:05:06 AMThe ?? syntax doesn't exist in PHP 5.6 which is why you get the errors you do, and PHP 5.6 is years out of date at this point. (PHP team is working on releasing 8.2 this year.)

SMF 2.0 series is good up to PHP 7.4, your mods may not be though.
@Arantor - many thanks for your help with this as it would have taken me a while to work out the cause of the issue on my own.

Even though PHP 5.x is very old I'm thinking of updating the code for this mod and another mod I co-author to ensure compatibility across PHP 5.x, 7.x and 8.x ...
Life doesn't have to be perfect to be wonderful ...

Arantor

I'm on the fence about the idea personally. While I appreciate people are stuck on older hosts sometimes, I'd honestly rather see the effort go into bringing things up to current-supported rather than supporting-phased-out.

I tend to look at Ubuntu as the benchmark here as a distribution that moves at a reasonable pace and keeps older versions around, and even then... well, let's just take a look:

Ubuntu 14.04 - support ended April 2019 - baseline is PHP 5.5
Ubuntu 16.04 - support ended April 2021 - baseline is PHP 7.0
Ubuntu 18.04 - support ends April 2028 - baseline is PHP 7.2
Ubuntu 20.04 - support ends April 2030 - baseline is PHP 7.4
Ubuntu 22.04 - support ends April 2032 - baseline is PHP 8.1

(Prior to Ubuntu 18.04, LTS was 5 years. As of 18.04, it is 10 years. This means Ubuntu team or someone affiliated with them will be backporting patches to these versions of the platform. You can assume then that PHP 7.2+ will be hanging around for a while.)

At this point supporting PHP below 7.0 is increasingly a tall ask for any project, I feel.

Sebastiii

Hello,
I have few point for you :)

Point 1)
I'm getting locally and online those errors :

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves;topic=journal-d-emilllie-part2.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/languages/InlineAttachments.english.php (eval?)
Ligne: 3855

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/MessageIndex.template.php (eval?)
Ligne: 3855

Each time a page is loaded, I'm getting this many times in a row, so this is a lot of error like you can see.
So there are more than 10000 errors logs.

Point 2)
Also, I'm using this mod that make conflict : https://custom.simplemachines.org/index.php?mod=3818
An older version, so it seems (1.5 where it's 2.0.3 now)

Point 3)
In Tapatalk, Inline image are ok in post but appear also at the bottom, this means we can see duplicate image in the post from Tapatalk App.

Thanks.

Arantor

The second error is in a board, not a topic - seems unlikely it would be this mod. Turn off eval to see where the errors really are - probably not this mod though.

Sebastiii

@Arantor
What do you mean to Turn off eval or how I can do that ?

Arantor

Admin > Maintenance > Server Settings > Disable template eval (tick) > save.

Then observe the new error messages that don't include 'eval?' in the error message and won't be lying about what they are any more...

GL700Wing

Quote from: Sebastiii on May 08, 2022, 05:47:13 AMPoint 1)
I'm getting locally and online those errors :

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves;topic=journal-d-emilllie-part2.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/languages/InlineAttachments.english.php (eval?)
Ligne: 3855

http://127.0.0.1/public_html/forum/index.php?pretty;board=journaux-de-reves.0
2: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Fichier: C:/wamp64/www/public_html/forum/Themes/default/MessageIndex.template.php (eval?)
Ligne: 3855

Each time a page is loaded, I'm getting this many times in a row, so this is a lot of error like you can see.
So there are more than 10000 errors logs.
That looks like a PrettyURLs issue to me ...

QuotePoint 2)
Also, I'm using this mod that make conflict : https://custom.simplemachines.org/index.php?mod=3818
An older version, so it seems (1.5 where it's 2.0.3 now)
What is the conflict/issue?

QuotePoint 3)
In Tapatalk, Inline image are ok in post but appear also at the bottom, this means we can see duplicate image in the post from Tapatalk App.
You need to install Tapatalk before this mod so if you've already installed Tapatalk you'll need to uninstall this mod and then reinstall it ...
Life doesn't have to be perfect to be wonderful ...

Advertisement: