ElkArte Community

Project Support => General ElkArte discussions => Topic started by: Spuds on July 05, 2022, 09:14:52 pm

Title: ElkArte 1.1.9
Post by: Spuds on July 05, 2022, 09:14:52 pm
Thinking it might be close to time to push out a 1.1.9.   Below is the current list of fixes/changes/enhancements since 1.1.8.  If there are other issues you know about, now is the time to let us know. 

Also there may be some ability to pull in a couple of 2.0 updates such as the "show more" on quotes and possibly part of Quick Quote or others.  TBH I've not looked in detail at any of that, just thinking about changes should backport with some ease.

So let me know, or not, :speak_no_evil: yer choice (and to head it off, not emoji to core, although I should update the 1.1 addon at some point)

Title: Re: ElkArte 1.1.9
Post by: ahrasis on July 05, 2022, 09:51:57 pm
Since 2.0 beta is not yet released, to allow further test on the feature updates etc and get better feedback, I think they should be backported.
Title: Re: ElkArte 1.1.9
Post by: Spuds on July 18, 2022, 02:57:18 pm
I've done some more work on my local and this is what I've added thus far.  Some of this was straight forward, some a bit more difficult due to changes in 2.0 vs 1.1.

Title: Re: ElkArte 1.1.9
Post by: ahrasis on July 18, 2022, 07:47:36 pm
Great. But don't need to push to much too, so may focus on releasing 2.0 beta.
Title: Re: ElkArte 1.1.9
Post by: radu81 on July 19, 2022, 02:29:59 am
TBH I didn't expect to see all this into 1.1, leave something for the 2.0 ;)
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 08, 2022, 03:09:21 pm
As we pass the 1 year anniversary of 1.1.8, I think 1.1.9 is about ready.  I'll post an update package FOR TESTING after this note.  I've broken down the changes into various top-level categories for easy viewing.  For those interested, each item has a ref link that will take you to the specific code changes.

1.1.9 Changelog

Title: Re: ElkArte 1.1.9
Post by: Spuds on October 08, 2022, 03:15:00 pm
Here is the PRELIMINAY patch package for upgrading 1.1.8 to 1.1.9.

As always if you do this, please do so on a backup or have a backup!!!

Note, this should run fine on 8.1, however 1.1.8 does not.  So you can upgrade then change to 8.1, but if you un-install then set your PHP version back to 8.0 or 7.4 or whatever you were running prior to 1.1.9  If you do not do this a great frown may appear on your face.

I'd appreciate the testing of this, not only the patch itself but of the new features/enchantments in 1.1.9, now is the time to find any bugs and report them so they can be fixed prior to release. (see the previous post for the list)


ETA; Removed prelim 1.1.9 patch attachment
Title: Re: ElkArte 1.1.9
Post by: Frenzie on October 09, 2022, 04:48:50 am
No time to test, still in the middle of moving, sorry. Good luck though! :)
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 09, 2022, 10:08:25 am
Good luck to you also :D
Title: Re: ElkArte 1.1.9
Post by: tino on October 09, 2022, 11:01:30 am
Quote from: Spuds – I'd appreciate the testing of this, not only the patch itself but of the new features/enchantments in 1.1.9, now is the time to find any bugs and report them so they can be fixed prior to release. (see the previous post for the list)

Installed without issue on a 1.1.8 forum. Everything seems to still work as it should.
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 09, 2022, 01:31:43 pm
Quote from: tino – Installed without issue on a 1.1.8 forum
Thank You.


I did notice one thing on an old test site.  If you are using SimplePortal < 1.0.1 (and since I did not formally release that, you probably are) then you MUST edit your Portal.subs.php file and change the following.

Code: (find) [Select]
'query' => empty($allowed) ? '0=1' : 'FIND_IN_SET(%s, \'' . implode(',', $allowed) . '\')',
Code: (replace) [Select]
'query' => empty($allowed) ? '0=1' : 'FIND_IN_SET(%s, "' . implode(',', $allowed) . '")',

If you don't then you will get a hacking attempt error from the db controller, and probably a 500 error on your site.
Title: Re: ElkArte 1.1.9
Post by: tino on October 09, 2022, 03:17:28 pm
That’s most likely caused by this change https://github.com/elkarte/Elkarte/commit/a748bfe58

Which brings it inline with Elkarte 2 behaviour.
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 09, 2022, 09:18:20 pm
Awesome!!  The beta patch is installed on two sites. 


Here's a bugz report (maybe). Attached image preview does not display on either site. Both use Attached Image Resize addon. This occurs using php 7.4 and 8.1. The attached images display properly once posted. 


Title: Re: ElkArte 1.1.9
Post by: NetFlag on October 10, 2022, 06:00:43 am
1.1.9 installed and runs under php 8.1.  :thumbsup:

@Spuds
Is it possible to use the variant "Darktanion" (dev) under 1.1.9?
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 10, 2022, 09:07:00 am
.
Quote from: tino – That’s most likely caused by this change https://github.com/elkarte/Elkarte/commit/a748bfe58 (https://github.com/elkarte/Elkarte/commit/a748bfe58)
That is the one ! (and its correct to do) .... really the SP code was incorrect
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 10, 2022, 09:28:32 am
Quote from: badmonkey – Here's a bugz report (maybe). Attached image preview does not display on either site. Both use Attached Image Resize addon. This occurs using php 7.4 and 8.1. The attached images display properly once posted.
OK I'll take a look at that and try and determine why that is happening.  (Starting In 2.0, the attachment image resize is part of the core, no more addon)

Quote from: NetFlag – Is it possible to use the variant "Darktanion" (dev) under 1.1.9?
It will need adjustments for 1.1.9, but It should, probably, mostly, work.  You will see wrong borders or element padding issues in a few places, maybe a few other issues as well.

To try you would need to edit the default theme index.template.php file and change the theme_variants line to read 'theme_variants' => array('light', 'besocial', 'dark'),  You would then need to add the _dark css directory from 2.0 and under the 1.1.9 themes/default/css directory (where _light and _besocial are)  Then choose it in your profile. 
Title: Re: ElkArte 1.1.9
Post by: ahrasis on October 12, 2022, 09:14:44 pm
Hacking attempt? I will check later and update.
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 13, 2022, 10:21:14 am
If you have simple portal installed .... See https://www.elkarte.net/community/index.php?topic=6141.msg44129#msg44129

I have a SP 1.0.1 just about ready to release to fix that and some other issues reported over the months since 1.0.0

Title: Re: ElkArte 1.1.9
Post by: Spuds on October 16, 2022, 01:28:41 pm
Quote from: badmonkey – Here's a bugz report (maybe). Attached image preview does not display on either site. Both use Attached Image Resize addon. This occurs using php 7.4 and 8.1. The attached images display properly once posted.
Back to this .... While looking at this I found a couple of items that needed to be addressed.

First the addon needed to be updated to fully support 1.1.9, specifically support for webp (if you enable that) and better integration with the attachment drop area on the post screen. 

While looking at all of that, I noticed
 - That the transparency detection code could be improved a bit,
 - There was an issue in the post attachment area, specifically when you have the resize addon, and it did the resize, the space left line was not updated to reflect the smaller file ... so if you uploaded a 2M file that was reduced to 250k, you were still docked the 2M
- When using imagick, you may get an empty thumbnail when uploading an animated gif, and you may loose the animation of said gif

All that said, I'm not sure this addresses the problem you reported, but its steps in the right direction.

Here are the files, only use if on 1.1.9 ... replace the two core files and install the new version of the resize addon
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 16, 2022, 05:05:22 pm
Many thanks for your work spuds!!  Unfortunately the preview still does not show?
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 16, 2022, 06:48:40 pm
Time for some more info gathering so I can fix this !

Just to be sure, you are referring to the little thumbnail that appears (or should) in the status bar attachment zone.
Are you using GD or Imagick (just so I use the right one)
Are you using a custom theme?  If so I need to check if there are any edits missing from the package.
Any errors in the browser console?
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 16, 2022, 08:13:16 pm
Quote from: Spuds – Time for some more info gathering so I can fix this !

Just to be sure, you are referring to the little thumbnail that appears (or should) in the status bar attachment zone.
Are you using GD or Imagick (just so I use the right one)
Are you using a custom theme?  If so I need to check if there are any edits missing from the package.
Any errors in the browser console?
Correct, the thumbnail by the status bar. The preview also fails in the editor if inlined in WYSIWYG mode. 

Both are available. Imagick is prioritized isn't it? 

The themes on both sites are default with custom css. 


Seems there could be a jquery issue at hand?  There are errors in the console log:


QuoteUncaught SyntaxError: Unexpected end of input (at jquery-ui-1.12.1.min.js:7:16012)


index.php:1          GET https://www.site.com/index.php?action=dlattach;sa=tmpattach;attach=post_tmp_1_d38f307e2c04dddc371b0ef2a7082431;topic=4390 502

Uncaught SyntaxError: Unexpected end of input (at jquery-ui-1.12.1.min.js:7:16012)
manifest.json:27 Manifest: Line: 27, column: 1, Unexpected token.
7XHR finished loading: GET "<URL>".
jquery-3.6.0.min.js:2 XHR finished loading: POST "https://www.site.com/index.php?action=attachment;sa=ulattach;api;p7z2h7MgySPX=BAcLw6ANOAlB6FjIc5AstyKxrA5SnP40;board=2".
send @ jquery-3.6.0.min.js:2
ajax @ jquery-3.6.0.min.js:2
sendFileToServer @ dropAttachments.js?R119:122
(anonymous) @ dropAttachments.js?R119:538
setTimeout (async)
runAttachmentQueue @ dropAttachments.js?R119:534
handleFileUpload @ dropAttachments.js?R119:524
(anonymous) @ dropAttachments.js?R119:692
dispatch @ jquery-3.6.0.min.js:2
v.handle @ jquery-3.6.0.min.js:2
index.php:1          GET https://www.site.com/index.php?action=dlattach;sa=tmpattach;attach=post_tmp_1_d38f307e2c04dddc371b0ef2a7082431;topic=4390 502
Image (async)
attr @ jquery-3.6.0.min.js:2
$ @ jquery-3.6.0.min.js:2
attr @ jquery-3.6.0.min.js:2
fileUploadedInterface @ dropAttachments.js?R119:423
onUploadSuccess @ dropAttachments.js?R119:390
(anonymous) @ dropAttachments.js?R119:166
c @ jquery-3.6.0.min.js:2
fireWith @ jquery-3.6.0.min.js:2
l @ jquery-3.6.0.min.js:2
(anonymous) @ jquery-3.6.0.min.js:2
load (async)
send @ jquery-3.6.0.min.js:2
ajax @ jquery-3.6.0.min.js:2
sendFileToServer @ dropAttachments.js?R119:122
(anonymous) @ dropAttachments.js?R119:538
setTimeout (async)
runAttachmentQueue @ dropAttachments.js?R119:534
handleFileUpload @ dropAttachments.js?R119:524
(anonymous) @ dropAttachments.js?R119:692
dispatch @ jquery-3.6.0.min.js:2
v.handle @ jquery-3.6.0.min.js:2
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 17, 2022, 09:54:08 am
Quote from: badmonkey – Both are available. Imagick is prioritized isn't it?
Yup ... it will choose Imagick over GD as the results are better.
Quote from: badmonkey – The themes on both sites are default with custom css.
That should not be a problem at all then.
Quote from: badmonkey – Uncaught SyntaxError: Unexpected end of input (at jquery-ui-1.12.1.min.js:7:16012)
That one is odd .. At first I thought it could be due to a bad json response from the server (in response to sa=tmpattach ... but its from jquery-UI which I don't think is normally loaded for the post page?  Could you provide me you list of addons so I can do some more digging?


Title: Re: ElkArte 1.1.9
Post by: Spuds on October 18, 2022, 08:57:39 am
Also, setting aside that it appears its jquery-UI throwing the error, could you look at your network tab and see what response you are getting for tmpattach request?   just wondering if there is something in that response, like a server cors error or php error in the response itself? Or maybe you enabled webp, in which case the thumbnail would be a webp image and that is causing an issue.  Feel free to pm me a site and temp userid so I can see the dev console myself.
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 18, 2022, 08:21:13 pm
Quote from: Spuds –
Quote from: badmonkey – Both are available. Imagick is prioritized isn't it?
Yup ... it will choose Imagick over GD as the results are better.
Quote from: badmonkey – The themes on both sites are default with custom css.
That should not be a problem at all then.
Quote from: badmonkey – Uncaught SyntaxError: Unexpected end of input (at jquery-ui-1.12.1.min.js:7:16012)
That one is odd .. At first I thought it could be due to a bad json response from the server (in response to sa=tmpattach ... but its from jquery-UI which I don't think is normally loaded for the post page?  Could you provide me you list of addons so I can do some more digging?


Here's an addon list:


Attachment Image Resize 1.0.7  
Bookmarks   2.5
ElkArte 1.1.2 patch 1.0
ElkArte 1.1.3 patch 1.1.3  
ElkArte 1.1.4 patch 1.1.4  
ElkArte 1.1.6 patch 1.0
ElkArte 1.1.7 patch 1.0
ElkArte 1.1.7 patch 1.0
ElkArte 1.1.8 patch 1.0
ElkArte 1.1.9 patch 1.0
Google Member Map   1.0.6  
Image Watermark 1.0
Lazy loading of images  0.0.2  
SimpleAds   1.0.3



Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 18, 2022, 08:28:08 pm
Quote from: Spuds – Also, setting aside that it appears its jquery-UI throwing the error, could you look at your network tab and see what response you are getting for tmpattach request?  just wondering if there is something in that response, like a server cors error or php error in the response itself? Or maybe you enabled webp, in which case the thumbnail would be a webp image and that is causing an issue.  Feel free to pm me a site and temp userid so I can see the dev console myself.
webp is enabled, though if memory serves it occurs when webp is disabled as well. A verfication test and update are in order.....

The network console does indicate a 502 error:

allow: GET, HEAD, POST
content-length: 552
content-type: text/html
date: Wed, 19 Oct 2022 00:22:50 GMT
server: nginx
:authority: bbs.zuwharrie.com
:method: GET
:path: /content?action=dlattach;sa=tmpattach;attach=post_tmp_777_b023f1c22944525f7e9f3b8e58e92446;topic=139287
:scheme: https
accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
cookie: Zuwharrie738=%5B777%2C%2205c27336b121b64491c00d800b07b24582c4f8143ec34ec29826ce6f14bb4964%22%2C1850919101%2C2%5D; PHPSESSID=9mat7d7qdmgvb6ffkc6156pr6v23g6j5qjmgbgl5clemnmhq3l6crk9vdjhmcitm
pragma: no-cache
referer: https://xxx.xxxxxxxx.com/content?action=post;topic=139287.0;last_msg=1369644
sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 18, 2022, 08:35:39 pm
OK, the previous statement is verified. The preview fails when webp support is disabled. Interestingly, the headers still indicated webp acceptance? webp is not in the allowed attachment extension field, either.


allow: GET, HEAD, POST
content-length: 552
content-type: text/html
date: Wed, 19 Oct 2022 00:31:57 GMT
server: nginx
:authority: bbs.zuwharrie.com
:method: GET
:path: /content?action=dlattach;sa=tmpattach;attach=post_tmp_777_017c4b85254e043a529f433d0de7f44c;topic=139287
:scheme: https
accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
cookie: Zuwharrie738=%5B777%2C%2205c27336b121b64491c00d800b07b24582c4f8143ec34ec29826ce6f14bb4964%22%2C1850919101%2C2%5D; PHPSESSID=9mat7d7qdmgvb6ffkc6156pr6v23g6j5qjmgbgl5clemnmhq3l6crk9vdjhmcitm
pragma: no-cache
referer: https://xxx.xxxxxxx.com/content?action=post;topic=139287.0;last_msg=1369644
sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 19, 2022, 03:20:32 pm
Quote from: badmonkey – OK, the previous statement is verified. The preview fails when webp support is disabled. Interestingly, the headers still indicated webp acceptance? webp is not in the allowed attachment extension field, either.
the webp in the headers is just the browser announcing what it supports.  Its similar to the accept-encoding header which lets the server know what compression methods it can handle gzip etc.   One could use the webp header to check if sending back a webp image was OK and if not quick transform the image to png or jpg.  I went the lazy route and let the admin choose support, figuring most browsers in the last 4 years support webp, and caniuse claims 97% support at this point.

OK back on task (I did the quick edit on your posts to remove the website just in case) ... I think the issue is with the watermark addon, it at least has some problems with 1.1.9, so hoping an update there will clear this up.   I'll post an updated package for that later today.
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 19, 2022, 04:16:28 pm
OK, uninstall your old watermark addon, and then install this beauty!

Not sure if this will fix the issue you are having, but at least this version does run on 1.1.9 where as the previous did not .... so its progress!
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 19, 2022, 05:26:51 pm
And just for completeness, and since I had to look, and since @emanuele45 is lazy ... here is an update to LazyLoading

The updates are pretty minor, but in 1.1.9 avatars and attachments have the loading="lazy" attribute on them, so the browser takes care of the lazy loading (enabled browsers that is ~ 90% are) so the change prevents the addon from changing those.  The browser is much "smarter" about what it loads, its not just waiting for it to enter the viewport (as this addon does) which provides a better user experience.

Also this does not require the emulation to install and updated the script to the latest (although the changelog shows no real change but anyway ..)
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 19, 2022, 09:37:56 pm
Quote from: Spuds – OK, uninstall your old watermark addon, and then install this beauty!

Not sure if this will fix the issue you are having, but at least this version does run on 1.1.9 where as the previous did not .... so its progress!
Many thanks! That said, the issue remains. The site is running on php7.4 rather than 8.1, if that matters here. 
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 20, 2022, 12:46:38 pm
Sent you a PM on my lack of progress :laughing:

As an experiment, please try the attached Attachment.controller.php (just replace the one in your sources/controller directory) and lets see if that does anything good for us.  Past that we really need to hope there is something in your Nginx error logs regarding the 502 that we are generating.
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 20, 2022, 08:35:46 pm
Quote from: Spuds – Sent you a PM on my lack of progress :laughing:

As an experiment, please try the attached Attachment.controller.php (just replace the one in your sources/controller directory) and lets see if that does anything good for us.  Past that we really need to hope there is something in your Nginx error logs regarding the 502 that we are generating.
Rockin, still a no go. Sure hope this doesn't send you on a wild goose chase then turn out a configuration issue on this end. :(

Here's an excerpt from the nginx error log after an upload:
Code: [Select]
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254415;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254417;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254419;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254421;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254423;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254425;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254427;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254429;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254431;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254433;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:10 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;topic=139214.0;attach=254435;image HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?topic=139214.msg1369697"
2022/10/21 00:23:25 [error] 2571542#2571542: *26 upstream sent invalid "Content-Length" header: "Content-Length: " while reading response header from upstream, client: IP addy, server: bbs.site.com, request: "GET /content?action=dlattach;sa=tmpattach;attach=post_tmp_777_6e976dbbe41ba5426878a1e07a75209b;topic=139214 HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/site.sock:", host: "bbs.site.com", referrer: "https://bbs.site.com/content?action=post;topic=139214.0;last_msg=1369694"

And access log from the same timeframe:

Code: [Select]
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254415;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254417;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254419;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254421;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254423;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254425;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254427;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254429;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254431;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254433;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
IP addy - - [21/Oct/2022:00:23:10 +0000] "GET /content?action=dlattach;topic=139214.0;attach=254435;image HTTP/2.0" 502 552 "https://bbs.site.com/content?topic=139214.msg1369697" "Mozilla/5.0 (Linux; Android 12; SM-G998U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Mobile Safari/537.36"
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 20, 2022, 09:34:15 pm
Well that is something to go on, and its in the area I tried to adjust in the previous attempt...  Please give this one a try, it simply turns off the content length header as a test, just to see if that is indeed what is causing the error.
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 20, 2022, 10:00:19 pm
Quote from: Spuds – Well that is something to go on, and its in the area I tried to adjust in the previous attempt...  Please give this one a try, it simply turns off the content length header as a test, just to see if that is indeed what is causing the error.
You're on the right track!  Attachments upload, and the preview shows!! 
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 20, 2022, 10:05:35 pm
:cool: thanks for doing all the testing.   I'll do some more looking at this tomorrow now that I know where/what the problem is!
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 21, 2022, 08:58:59 am
Well this should be the winner winner, :chicken: chicken dinner ! 

The culprit (I believe) was a misplaced comma (of all things) which caused the sending of a bad content length header.  I don't really have an explanation for why it manifested as a 502 on some sites, and others seemed to ignore the bad header.   Don't know if that was a specific PHP level, or Web Server config, or ??

Attached is the updated Attachments.controller.php file for 1.1.9 only.  Give this a try and lets see what we get :pray:

Also, I noticed that the lazy loading addon was preventing the showing of the admin menu icons, so I've attached an update for that as well.  I'll post that package in the correct thread a bit later on.
Title: Re: ElkArte 1.1.9
Post by: badmonkey on October 21, 2022, 08:31:35 pm
Odd what chaos a few misplaced characters can cause. Years ago several random characters on a document made life miserable for me. Turns out the random characters just happened to spell my name, and the document was a marriage certificate. Who knew!?

Seriously, I'll give it the test sometime this evening!

Edit: the latest version appears to be operating properly!
Title: Re: ElkArte 1.1.9
Post by: Spuds on October 22, 2022, 04:42:32 pm
Quote from: badmonkey – Odd what chaos a few misplaced characters can cause. Years ago several random characters on a document made life miserable for me. Turns out the random characters just happened to spell my name, and the document was a marriage certificate. Who knew!?
Gotta say, this made me laugh all day :rofl:

Glad the fix worked, now I can repack 1.1.9
Title: Re: ElkArte 1.1.9
Post by: badmonkey on November 08, 2022, 09:13:17 pm
Another potential bugz are spotted. Quoted messages containing apostrophes and quote marks yields decimal code or html code, respectively. There could be others, these are the ones noted so far. 
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 09, 2022, 05:30:30 pm
Thanks, I'll take a look at that.  Keep those reports coming !
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 09, 2022, 09:05:43 pm
I was pretty sure I knew what was causing this, and now having looked at it, confirmed.

Long story, but we made a change in the quick quote function to account for unescaped special characters like & that made it into the DB due to an error in the post by email function.   The fix for that was to allow unescaped characters in the XML response, but that also means escaped characters are not unescaped by magic.

So lets try to fix the issue another way .... in post.controller.php find
Code: (find) [Select]
			$context['quote']['xml'] = strtr($context['quote']['xml'], array('&nbsp;' => ' ', '<' => '&lt;', '>' => '&gt;'));
Code: (replace) [Select]
			$context['quote']['xml'] = strtr(Util::htmlspecialchars($context['quote']['xml']), array('&nbsp;' => '&#160;'));

Then in Xml.template.php lets revert the proposed change
Code: (find) [Select]
	<quote><![CDA' . 'TA[', cleanXml($context['quote']['xml']), ']' . ']></quote>
Code: (replace) [Select]
	<quote>', cleanXml($context['quote']['xml']), '</quote>

That should fix the original issue but not cause this new issue.
Title: Re: ElkArte 1.1.9
Post by: Steeley on November 10, 2022, 01:48:42 am
@Spuds  - at first I thought that was reverting the fix we made in 1.1.6, for a similar problem in Xml.template.php function template_quotefast()

https://www.elkarte.net/community/index.php?topic=6157.0

..but after a closer look, no...  but it does raise the question of whether it should?
 
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 10, 2022, 05:51:53 pm
That actually is the same one.  The bug that you reported has been around for "a bit", so we have to deal with the fact that some posts will have this issue.

The original fix was the CDATA idea which allows us to send unescaped character data, but then we should un-escape anything escaped.  Note that the line in question may look like what you posted <quote><![CDATA[ or if done by the patch system, it will be <quote><![CDA' . 'TA[ the later due to the fact the patch system is XML so you can't have a CDATA string in it as it would not be a valid file, so it gets broken and concatenated.

So you should try to undo the edit you made and then add the new edit to the post.controller, which escapes the problematic characters if they are not already escaped (e.g. it will not cause &amp; => &amp;amp;)
Title: Re: ElkArte 1.1.9
Post by: Steeley on November 10, 2022, 09:26:39 pm
Quote from: Spuds – That actually is the same one.  The bug that you reported has been around for "a bit", so we have to deal with the fact that some posts will have this issue.

The original fix was the CDATA idea which allows us to send unescaped character data, but then we should un-escape anything escaped.  Note that the line in question may look like what you posted <quote><![CDATA[ or if done by the patch system, it will be <quote><![CDA' . 'TA[ the later due to the fact the patch system is XML so you can't have a CDATA string in it as it would not be a valid file, so it gets broken and concatenated.

So you should try to undo the edit you made and then add the new edit to the post.controller, which escapes the problematic characters if they are not already escaped (e.g. it will not cause &amp; => &amp;amp;)

Alrighty then, I'll make the change and then update the 1.1.6 fix topic after testing (oddly, none of my users pointed it out if they had encountered the problem - and I haven't noticed it - but they're a lazy bunch and somewhat adverse to using symbols and punctuation other than periods, commas and the occasional  exclamation point - if they even use those - anyway..) 
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 11, 2022, 10:06:49 am
Quote from: Steeley – none of my users pointed it out if they had encountered the problem - and I haven't noticed it - but they're a lazy bunch
That is how bugs often go, and why some remain for so long! ... Have to get the right conditions, maybe notice there is a problem, maybe report it, maybe someone will make a fix, maybe it will be the right fix LOL
Title: Re: ElkArte 1.1.9
Post by: Steeley on November 13, 2022, 06:26:46 pm
Quote from: Spuds – That should fix the original issue but not cause this new issue.

Well, I made the change,  and yea, that works too.. 😝

....so I posted an update in the 1.1.6 thread (https://www.elkarte.net/community/index.php?topic=6157.msg44212#msg44212) 🦝
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 22, 2022, 08:14:23 pm
Attached is the "final" version of 1.1.9, assuming there are no other issues reported.

Changes from the previous candidate (that I recall)

- fixes the attachment/ preview error reported by @badmonkey
- fixes the fix for the quote function reported by @Steeley
- adds some additional password conversion functions for recent releases form other forums (found during the open importer updates)
- fix an issue where if there was not privacy policy file, and you used the checkbox registration, and empty accept for would show.
- fix an issue where ILA was outputting control characters (read tab and newline) that caused problems with addons (read print to pdf)
- prevent potential 502 gateway failed error when downloading a file (regression error)
+ improve imagick process for thumbnails when transparency is detected
+The reduced upload file size was not reflected back in the UI, for addon use (2.0 backport)
+The resize flag was not set correctly for UI use (part of previous issue)

ETA: Package Removed
Title: Re: ElkArte 1.1.9
Post by: Steeley on November 22, 2022, 09:38:06 pm
Quote from: Spuds – Attached is the "final" version of 1.1.9, assuming there are no other issues reported.

Changes from the previous candidate (that I recall)
..
- fixes the fix for the quote function reported by @Steeley
..

And my legacy lives on..  :partying_face
Title: Re: ElkArte 1.1.9
Post by: badmonkey on November 22, 2022, 10:39:37 pm
As always, great work @Spuds !

Thanks for all you do!
Title: Re: ElkArte 1.1.9
Post by: NetFlag on November 23, 2022, 05:04:01 am
Thanks @Spuds !
The official release of 1.1.9 is coming closer.  :thumbsup:
Title: Re: ElkArte 1.1.9
Post by: radu81 on November 24, 2022, 12:48:30 pm
Quote from: Spuds – Attached is the "final" version of 1.1.9, assuming there are no other issues reported.
I tried this on my forum, it installs without errors, but after that I get an error:
Zend OPcache API is restricted by "restrict_api" configuration directive
I click on "Back" button and I get this error:
Undefined class constant 'ATTR_RESET'
After this my forum is not visible, I only see a white page with this error:
Fatal error: Uncaught Error: Undefined class constant 'ATTR_RESET' in /public/sources/subs/Ila.integrate.php:104 Stack trace: #0 /public/sources/Hooks.class.php(110): Ila_Integrate::integrate_additional_bbc(Array) #1 /public/sources/Subs.php(1411): Hooks->hook('integrate_addit...', Array) #2 /public/sources/subs/BBC/ParserWrapper.php(388): call_integration_hook('integrate_addit...', Array) #3 /public/sources/subs/BBC/ParserWrapper.php(419): BBC\ParserWrapper->getCodes() #4 [internal function]: BBC\ParserWrapper->getAutolinkParser('message') #5 /public/sources/subs/BBC/ParserWrapper.php(130): call_user_func(Array, 'message') #6 /public/sources/subs/BBC/ParserWrapper.php(183): BBC\ParserWrapper->getParsersByArea('message') #7 /srv/users/serve in /public/sources/subs/Ila.integrate.php on line 104

I guess I need to disable ILA add-on and maybe the other add-ons that were updated recently, then retry to update Elkarte and the add-ons.

I use PHP 7.4, but after this update I will switch to 8.1.
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 24, 2022, 02:15:07 pm
That is a little strange.

The ATTR_RESET is due to the updates in ILA ... it installs a new ila.integration.php file which requires a refresh of the hooks (which the install / uninstall package does take care of). I've only seen that error during uninstall and it only lingered for a single page load (I did fix that as well).

Since you are getting that error, it means it did install that new file but something to do with the opcache caused some other failure after that.  You can probably fix the issue by using the 1.1.8 version of ila.integration.php (the old file is included in the1.1.9 package under the 1.1.8 directory).  Then we need to understand why the opcache blocked.

Title: Re: ElkArte 1.1.9
Post by: Spuds on November 24, 2022, 02:33:10 pm
In the FWIW, in the updates that I've done, I've first updated all of the addons, then applied the 1.1.9 update (all on 7.4)

When you stop pulling your hair out, what do you have in your php.ini file for the opcache.restrict_api setting?  There are checks in the code to prevent this error (since, 1.1.4) so I'm curious as to why its showing up (again).  The error was caused by the system attempting to flush the opcache  after the patch since at that point its no longer valid (but it checks if its allowed).

ETA: I added additional protection to the opcache_reset() call in the patch file (updated the attachment above), not sure if that was the cause but may help.
Title: Re: ElkArte 1.1.9
Post by: radu81 on November 24, 2022, 05:53:12 pm
Updating first the Resize Images add-on and then update to 1.1.9 seems to work, I used the patched file you posted.

There are other problems with Simple Portal, but I guess I should have update the SP add-on before updating Elkarte. SP Error Spoiler (click to show/hide)
Quote from: Spuds – what do you have in your php.ini file for the opcache.restrict_api setting?
Code: [Select]
opcache.restrict_api=/restricted

I went back to 1.1.8 (large update) then installed the update to 1.1.9. It worked without problems.

p.s. Where can I find the setting to enable the quick quote option? I searched for "quick" or "quote" in ACP settings without results.
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 24, 2022, 07:23:19 pm
Quote from: radu81 – Updating first the Resize Images add-on and then update to 1.1.9 seems to work, I used the patched file you posted.
Cool ... The original file had the same refresh code as used in 1.1.4, but I added another check and supression.

https://www.elkarte.net/community/index.php?topic=6141.msg44129#msg44129
Quote from: radu81 – There are other problems with Simple Portal, but I guess I should have update the SP add-on before updating Elkarte.
https://www.elkarte.net/community/index.php?topic=6141.msg44129#msg44129  I did put together a 1.0.1 package and posted it on the github site to help.  I've used this on a few sites and all seems to be OK with it, but if you see errors, let me know.

Humm .... typically that is empty or set to BOARDDIR like /var/www/mysite  Anyway with that setting it would run the opcache_reset() function as the function felt it was safe to do so (e.g. BOARDDIR is not restricted) .. Anyway good to know that the tweak helped.

Quote from: radu81 – p.s. Where can I find the setting to enable the quick quote option?
It should just be ON ... I did not add a setting for that, its just tied to quick reply function.   I bet its showing up off screen (scroll down and see if you see it) ... I don't recall any template changes being required, but it may have needed a CSS update.  If you are running a custom theme that may not have happened.  I'll look into that and post what is needed.
Title: Re: ElkArte 1.1.9
Post by: radu81 on November 24, 2022, 08:09:22 pm
Updated SP, no errors or problems so far. Only error I see in Elk log:
Type of error: Critical
Guest
Illegal character (') used in query...
Function: bb2_db_query
/index.php?action=login2;quicklogin
 File: /sources/ext/bad-behavior/badbehavior-plugin.php
Line 108
Code: [Select]
	
$result = $db->query('', $query, array());

As for the quick quote I am using the default theme, BeSocial variant. I tried with Light version but same result. Could be due to the fact that I had the Quick Quote add-on which I uninstalled?
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 24, 2022, 09:56:44 pm
It probably means I forgot to update the beSocial.css LOL ... I'll take a look in the AM
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 25, 2022, 08:50:14 pm
I checked this on my two test sites, basic 1.1.9 with beSocial and the quote selected showed up as expected.   Is this a test site I can see?  If so shoot me the address so I can :eye_in_speech_bubble:
Title: Re: ElkArte 1.1.9
Post by: radu81 on November 25, 2022, 08:53:37 pm
I'll send you a PM
Title: Re: ElkArte 1.1.9
Post by: ksamochkin on November 26, 2022, 01:07:55 am
after installing the patch, the attachments section began to look like this
(Link-10156)

and it was like this
(Link-10158)

is it really necessary to roll back
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 26, 2022, 07:52:39 am
It installs an updated dropAttachments.js file in themes/default/scripts ... check if the new file is there (its header will have 1.1.9)

IF you created a custom theme and copied that file to your custom theme dir, you will need to replace it with the update file (or simply remove it as the system will simply grab it from the default directory)

Be sure to flush your browser cache, even though it has a ?119 to force a refresh
Title: Re: ElkArte 1.1.9
Post by: ksamochkin on November 26, 2022, 09:11:16 am
Quote from: Spuds – It installs an updated dropAttachments.js file in themes/default/scripts ... check if the new file is there (its header will have 1.1.9)

IF you created a custom theme and copied that file to your custom theme dir, you will need to replace it with the update file (or simply remove it as the system will simply grab it from the default directory)

Be sure to flush your browser cache, even though it has a ?119 to force a refresh
version 1.1.9, resetting the cache didn't help
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 26, 2022, 09:45:33 am
From a quick look, you have this in your template quickQuote.txt = 'Quick Quote'; on the posting page.  That is not valid so the rest of the javascirpt on that page does not run (including the drag/drop attachment area)

The above is not part of 1.1.9, so it should be removed.
Title: Re: ElkArte 1.1.9
Post by: ksamochkin on November 26, 2022, 09:49:37 am
Quote from: Spuds – From a quick look, you have this in your template quickQuote.txt = 'Quick Quote'; on the posting page.  That is not valid so the rest of the javascirpt on that page does not run (including the drag/drop attachment area)

The above is not part of 1.1.9, so it should be removed.
Yes, it helped, but it's a pity to part with that useful mod
Title: Re: ElkArte 1.1.9
Post by: ksamochkin on November 26, 2022, 09:51:23 am
Another note, the site on version 1.1.9 has become longer to load
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 26, 2022, 10:15:03 am
Quote from: ksamochkin – Yes, it helped, but it's a pity to part with that useful mod
Its still part of 1.1.9, but that looked to be a remnant from an early test version of 1.1.9 and its just that line was no longer needed.
Quote from: ksamochkin – Another note, the site on version 1.1.9 has become longer to load
That could be the "combine css/js" hives being re-build due to the changes.  When those are first created it can slow the page load, should only be a temporary issue.  You can disable that function while you are working on your site, and when you are done setting everything up, then enable it.

The other possible slow down is often hostname lookups which are slow on some servers.  You can disable that in you elkarte admin panel under servers.

Title: Re: ElkArte 1.1.9
Post by: ahrasis on November 27, 2022, 09:23:47 pm
Should 1.1.9 be released by now or there are something more needed to be fixed and/or added?
Title: Re: ElkArte 1.1.9
Post by: Spuds on November 28, 2022, 05:47:41 pm
I've got it installed on my "robot friendly" site for abuse testing and several other sites.  I did notice a small issue with bad behavior (results in error log spam)  that I'll fix in the final patch. 

I am also going to add a step to patch SP during the install since if you don't update SP before the patch you could end up with a defunct site.   Its not normal to patch an addon, but in this case I think its prudent.

Going to final this weekend is my goal.   I also want this to be done so I can get back to 2.0 !!
Title: Re: ElkArte 1.1.9
Post by: ahrasis on December 06, 2022, 09:06:33 pm
Quote from: Spuds – If you have simple portal installed .... See https://www.elkarte.net/community/index.php?topic=6141.msg44129#msg44129

I have a SP 1.0.1 just about ready to release to fix that and some other issues reported over the months since 1.0.0
I do not have SP installed and reverting back to 1.1.8 seems to work. When I re-patched with 1.1.9 it happened again. I will test again later.
Title: Re: ElkArte 1.1.9
Post by: ahrasis on December 06, 2022, 10:02:25 pm
I restored 1.1.8 version from the zip file again making sure all files are the original 1.1.8 and no hooks. Install the 1.1.9 patch. And the hacking attempt comes again. Error log reported this:

(Link-10181)
Title: Re: ElkArte 1.1.9
Post by: Spuds on December 08, 2022, 08:20:17 am
Ah thanks for those details.

I had seen bad behavior log errors on a test site, but not during the patch phase.

I've attached the fixed plugin which should resolve that error.  Just replace the one in ...sources\ext\bad-behavior 
Title: Re: ElkArte 1.1.9
Post by: ahrasis on December 08, 2022, 10:01:12 am
Thanks, this did the trick.
Title: Re: ElkArte 1.1.9
Post by: Spuds on January 16, 2023, 03:27:10 pm
Once again, I think 1.1.9 is about readytm  I'll post the latest patch package FOR TESTING after this note. 

This update should address all of the items brought up in this thread, plus some reported on github, some pm reported, and some just found.  The only open issue that is not addressed (that I am aware) is one @radu81 reported where the WEBP ILA  in preview mode appears to be full resolution, seems like RL has consumed him for now so work on that will have to wait  :wink:

Note its important to get 1.1.9 finalized as the 1.1.8 install package does not work on PHP 8.1 and PHP 7.4 is essentially EOL at this point (in terms of support and security patches).  I may update the 1.1.8 install package.

I've updated and again broken down the changes into various top-level categories for easy viewing.  For those interested, each item has a ref link that will take you to the specific code changes.

1.1.9 Changelog

Title: Re: ElkArte 1.1.9
Post by: Spuds on January 16, 2023, 03:48:12 pm
1.1.9 is a big update, mainly since its been over a year since 1.1.8.  We were not planning on a 1.1.9 but since 2.0 is taking some extra time, it seemed like we should do a stop gap release and get PHP 8.1 addressed, a bunch of fixes (many edge cases) and toss in some new features (backported from 2.0)  All of that is detailed in the above post.

IF <-- that is in bold to gather attention!  ... you installed a previous 1.1.9 patch and are still using it and you enabled site metadata in the ACP (features -> general) then turn that off before you uninstall the old patch.  When I went to uninstall the previous 1.1.9 patch on a couple of sites I got the ever fun 500 error :boom:  However in good diagnostic form I just kept hitting page refresh and it came back so I believe the cause was that integration was still being attempted.  I've put a fix for that condition in the new package.  All I can say is if you get that error, a page refresh or two will get past that so you can delete the old and install the new.
Title: Re: ElkArte 1.1.9
Post by: badmonkey on January 16, 2023, 04:49:02 pm
"Testing" is underway!  Thanks again @Spuds 
Title: Re: ElkArte 1.1.9
Post by: Steeley on January 16, 2023, 06:07:13 pm
Quote from: Spuds – Once again, I think 1.1.9 is about readytm  I'll post the latest patch package FOR TESTING after this note. 

This update should address all of the items brought up in this thread, plus some reported on github, some pm reported, and some just found.  The only open issue that is not addressed (that I am aware) is one @radu81 reported where the WEBP ILA  in preview mode appears to be full resolution, seems like RL has consumed him for now so work on that will have to wait  :wink:

Note its important to get 1.1.9 finalized as the 1.1.8 install package does not work on PHP 8.1 and PHP 7.4 is essentially EOL at this point (in terms of support and security patches).  I may update the 1.1.8 install package.

{snip}


Apologies if this appears to be a stupid (or redundant) suggestion, but if it's not listed up front in a "system requirements" section of the package description for download, it might be handy to note what PHP versions are supported by each EA version. While 7.4 is on the cusp of EOL, it is the latest version available to me unless I want to go outside of my host-provided packages. (I'm not sure if that lack of newer options is due to platform compatibility issues or a missing round-tuit, but it is what it is.)

And, since EA isn't the only code package running on my server, every time I upgrade my PHP version I have to run compatibility checks on everything else too, and stepping up to 7.x for another application forced me to replace several other legacy applications I was running with ones that weren't limited at 5.6, and then port over the data (square-peg/round hole exercise).  Consequently I'm not sure what else is going to break if I were to step up to v. 8.x

Not that I'm looking to upgrade (I suspect what I have running now will live longer than I and most of my users will), but if it's not there already somewhere, others may find that version compatibility information "up front" nice to know, ya know.. :undecided:

-=In the readme.md file in 1.16 (for example) - says it's good with PHP 5.3 "and newer" but... "how much newer?". Like 8.3? If 1.1.8 doesn't play well with 8.x, I suspect 1.1.6 won't either.
Title: Re: ElkArte 1.1.9
Post by: DeadMan on January 16, 2023, 07:48:32 pm
Was going to try it on one of my not-so-active forums, but seem to have way too many errors due to my theme.
Separation by @Spuds is the theme.
Here's list of the errors: (Only the failed edits listed)

Code: [Select]
Separation
Execute Modification ./themes/elk_theme_separation_11/Display.template.php Test failed
1. Replace ./themes/elk_theme_separation_11/Display.template.php Test failed
2. Replace ./themes/elk_theme_separation_11/Display.template.php Test failed
3. Replace ./themes/elk_theme_separation_11/Display.template.php Test failed
4. Replace ./themes/elk_theme_separation_11/Display.template.php Test failed
5. Replace ./themes/elk_theme_separation_11/Display.template.php Test failed
6. Replace ./themes/elk_theme_separation_11/Display.template.php Test failed

Execute Modification ./themes/elk_theme_separation_11/MessageIndex.template.php Test failed
1. Replace ./themes/elk_theme_separation_11/MessageIndex.template.php Test failed
2. Replace ./themes/elk_theme_separation_11/MessageIndex.template.php Test failed

Execute Modification ./themes/elk_theme_separation_11/css/index.css Test failed
1. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
3. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
4. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
5. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
6. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
8. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
10. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
11. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
12. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
13. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
14. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
17. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
20. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
22. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
23. Replace ./themes/elk_theme_separation_11/css/index.css Test failed
26. Replace ./themes/elk_theme_separation_11/css/index.css Test failed

Execute Modification ./themes/elk_theme_separation_11/css/rtl.css Test failed
2. Replace ./themes/elk_theme_separation_11/css/rtl.css Test failed

Execute Modification ./themes/elk_theme_separation_11/index.template.php Test failed
1. Replace ./themes/elk_theme_separation_11/index.template.php Test failed
2. Replace ./themes/elk_theme_separation_11/index.template.php Test failed
Title: Re: ElkArte 1.1.9
Post by: ahrasis on January 17, 2023, 06:50:01 pm
I think that is normal for custom themes, right?
Title: Re: ElkArte 1.1.9
Post by: DeadMan on January 17, 2023, 08:39:14 pm
Well... Ummm... Duh.... LOL  :tongue:
Title: Re: ElkArte 1.1.9
Post by: NetFlag on January 18, 2023, 04:20:27 am
Except for the message "/sources/subs/Portal.subs.php    File not found", it slips through easily.
Vanilla installation without portal. Therefore the logical error message. ;)
As always good work @Spuds !  :thumbsup:
Title: Re: ElkArte 1.1.9
Post by: ahrasis on January 18, 2023, 07:41:37 am
That is to cover the portal, if one has it installed, I think.
Title: Re: ElkArte 1.1.9
Post by: Spuds on January 20, 2023, 05:52:27 pm
Quote from: ahrasis – That is to cover the portal, if one has it installed, I think.
That is correct.  If you fail to upgrade the portal then you would either get a hacking attempt or a 500 error.  I added the portal edit in the 1.1.9 package simply to avoid someone breaking there forum during an upgrade.  I would not normally do that, but in this case it seemed prudent.
Title: Re: ElkArte 1.1.9
Post by: Spuds on January 20, 2023, 06:34:47 pm
Quote from: ahrasis – I think that is normal for custom themes, right?
Oh yeah! ... The patch file will give it a "go" but if the theme made modification to the same area (even an extra space), it will simply not be able to do anything.  The (generally) good thing is that the custom theme should still work as is, it will just lack the new features.

In adding the quick quote, quote more, and structed data capability, it meant edits to index.template and display.template both of which are some of the most commonly edited files when making a custom theme.  I've done my best to outline how/what to edit in a serries of "how to add the 1.1.9 xyz to your theme" posts under the theme board.
Title: Re: ElkArte 1.1.9
Post by: nwsw on January 21, 2023, 05:27:28 pm
Thanks for the update. I decided to give it a try on our site. I did make a change to facilitate my git based release management and the need to update the database:


Please consider supporting git merge for release updates like this, which can be accomplished via upgrade.php (https://github.com/elkarte/Elkarte/blob/development/install/upgrade.php).
Title: Re: ElkArte 1.1.9
Post by: Spuds on January 21, 2023, 07:05:35 pm
@nwsw  that is an awesome idea !!
Title: Re: ElkArte 1.1.9
Post by: Spuds on January 31, 2023, 01:59:52 pm
@radu81 please try this file and see if it fixes the issue on your server. 

The issue appears to be that your server has webp support in GD but not in IM.  The system will choose IM over GD but it was not smart enough to "fall back" to GD for webp processing if that was the only option.  So what happened is the webp file simply passed through as it was an allowed extension type.

Save the current one, you will need to restore it in order to uninstall the test 1.1.9 patch and install the fine when I publish it.

Just for reference, this is how the system should behave in doing WebP Processing
Title: Re: ElkArte 1.1.9
Post by: radu81 on January 31, 2023, 06:50:45 pm
I tried but I get the same results on my forum, webp image is not resized, in preview mode and also in the post message, instead I get this error in Elk log:
Thumbnail error (unable to open image `/tmp/magick-19957ybT8mdDES6BS': No such file or directory @ error/blob.c/OpenBlob/2712)
Title: Re: ElkArte 1.1.9
Post by: Spuds on February 01, 2023, 10:32:49 am
I found another area where the fallback was not working, so it was still trying to use IM on the webp image, which on your server is not cool.  That blob error was the output of the error line we added, so at least I knew where to look.  Should be fixed, lets hope there are no more problems.
Title: Re: ElkArte 1.1.9
Post by: radu81 on February 03, 2023, 05:50:07 am
Seems to work fine now! Thanks Spuds!