Skip to main content
ElkArte 1.1.7 Patch Testing Started by Spuds · · Read 77512 times 0 Members and 5 Guests are viewing this topic. previous topic - next topic

ElkArte 1.1.7 Patch Testing

Hi Everyone,

I've updated the site to the most current 1.1.7 repo status for some early testing.

I have also prepared a preliminary patch for updating 1.1.6 <-> 1.1.7 and I'd like to ask for your help in testing.  I'm not sure what fixes/updates may remain to add to this patch so I can't say for sure its final.  @emanuele45 do you know of other open issues we need to address or ideas about the remaining ones on github for the 1.1.7 milestone.  There are a few still open.

Tests needed: install/uninstall on a clean 1.1.6 forum.

Likely there are some things that are broken so always remember some users may experience a severe allergic reaction at the injection point.  This is normal for testing!!!  Its a pretty large patch with lots of ingredients.

Hopefully it will install fine (I think I remembered all the things to update, but  creating these patches bites), worst case you'll get errors during install.  Please report them. :)
Last Edit: April 24, 2021, 10:39:58 am by Spuds

Re: ElkArte 1.1.7 Patch Testing

Reply #1

Will test it soon.

Re: ElkArte 1.1.7 Patch Testing

Reply #2

I will test soon too and give some report

quick update patch installed on my test-forum no problem or errors to report
Screenshot from 2021-01-03 15-33-47.jpg
the forum was not a fresh 1.1.6 install but was a 1.1.5 patched to 1.1.6

very few mods on it...


http://zxbelt.altervista.org/forum/index.php
Patch 1.1.7 removed

these are my adds on
Screenshot from 2021-01-03 15-43-56.jpg

Finally back again on 1.1.7
Last Edit: January 03, 2021, 09:56:16 am by Zioclive

 

Re: ElkArte 1.1.7 Patch Testing

Reply #3

I'm getting this error now when I view a topic using postgresql

Code: [Select]
ERROR: LIMIT #,# syntax is not supported
LINE 11: LIMIT 0, 15) AS o
^
HINT: Use separate LIMIT and OFFSET clauses.
File: /var/www/html/Elkarte/sources/subs/Topic.subs.php
Line: 2198

Note: Your database version is 1.1.6.


Re: ElkArte 1.1.7 Patch Testing

Reply #5

Quote from: tino – I'm getting this error now when I view a topic using postgresql
 .....
Note: Your database version is 1.1.6.[/code]
Thank you for testing and the report

I found that one while testing on 2.0 (specifically when I pulled in the 1.1.7 changes) and have fixed it on my local.  We changed from temp tables to sub selects in one area for 1.1.7 (performance) and our postgresql  translator failed to understand that and properly change the LIMIT X,Y to postgresql  LIMIT X OFFSET Y syntax.

If you could test the following which is what I did and see if it works for you.

In Db-postgresql.class.php
Code: (find) [Select]
-		$db_string = preg_replace('~\sLIMIT\s(\d+|{int:.+}),\s*(\d+|{int:.+})\s*$~i', 'LIMIT $2 OFFSET $1', $db_string);
Code: (replace) [Select]
		$db_string = preg_replace('~\sLIMIT\s(\d+|{int:.+}),\s*(\d+|{int:.+})\s*(.*)$~is', 'LIMIT $2 OFFSET $1 $3', $db_string);


Re: ElkArte 1.1.7 Patch Testing

Reply #7

Quote from: Spuds –
Quote from: tino – I'm getting this error now when I view a topic using postgresql
 .....
Note: Your database version is 1.1.6.[/code]
Thank you for testing and the report

I found that one while testing on 2.0 (specifically when I pulled in the 1.1.7 changes) and have fixed it on my local.  We changed from temp tables to sub selects in one area for 1.1.7 (performance) and our postgresql  translator failed to understand that and properly change the LIMIT X,Y to postgresql  LIMIT X OFFSET Y syntax.

If you could test the following which is what I did and see if it works for you.

In Db-postgresql.class.php
Code: (find) [Select]
-		$db_string = preg_replace('~\sLIMIT\s(\d+|{int:.+}),\s*(\d+|{int:.+})\s*$~i', 'LIMIT $2 OFFSET $1', $db_string);
Code: (replace) [Select]
		$db_string = preg_replace('~\sLIMIT\s(\d+|{int:.+}),\s*(\d+|{int:.+})\s*(.*)$~is', 'LIMIT $2 OFFSET $1 $3', $db_string);

That corrects the issue, I had changed the SQL but I noticed other locations where it was incorrect so stopped.

Re: ElkArte 1.1.7 Patch Testing

Reply #8

Quote from: ahrasis – Quick reply smiley (gif) images has double back slash like in here:
https://www.elkarte.net/community/smileys/default//smiley.gif

I think should be fixed in 1.1.7 if considered a bug.
I'm going to guess that's because you have a trailing '/' in the ACP smiley settings URL.   We should disallow that when its set /saved.   That does not actively fix sites with the extra / but would prevent it in the future.

Re: ElkArte 1.1.7 Patch Testing

Reply #9

I could not find it in my ACP settings for smileys so I think the bug is in the code.It is in this forum quick reply smileys too.  ;D

Re: ElkArte 1.1.7 Patch Testing

Reply #10

Test :D (I got
Code: [Select]
https://www.elkarte.net/community/smileys/default/cheesy.gif
from the QR ... are you using the full editor there maybe?

Re: ElkArte 1.1.7 Patch Testing

Reply #11

I get the following when doing a reply. 

O:-)

Code: [Select]
https://www.elkarte.net/community/smileys/default/angel.gif

Re: ElkArte 1.1.7 Patch Testing

Reply #12

Quote from: Spuds – Test :D (I got
Code: [Select]
https://www.elkarte.net/community/smileys/default/cheesy.gif
from the QR ... are you using the full editor there maybe?
Yes. The one in quick reply full editor, not its output in the post. You can check the image in quick reply with full editor that each smileys have double backslash in its url by checking its link or simply viewing the smiley image in a new tab or windows. Very minor bug I'd say.

Re: ElkArte 1.1.7 Patch Testing

Reply #13

Another error I think releated to the same thing. When going to edit an existing post I get the following;

Quote

    admin
    Today at 04:23:51 pm
    192.168.0.15

    Mmh83QsxVcT8TrmU99MCYvSvwJHLvOh9
    Type of error: database
    Database Error: ERROR: syntax error at or near "OFFSET"
    LINE 14: LEFT JOIN elkarte_ OFFSET 0 members AS mem ON (mem.id_memb...
    ^

    http://192.168.0.70/Elkarte/index.php?action=post;msg=3;topic=3.0

    File: /var/www/html/Elkarte/sources/subs/Topic.subs.php
    Line: 1621

That's not quick edit that works correctly. It's also on postgresql.

To help here is the query before and after the preg_replace

Before
Code: [Select]
string(520) "
SELECT
m.subject, COALESCE(mem.real_name, m.poster_name) AS real_name, m.poster_time, m.body,
m.id_msg, m.smileys_enabled, m.id_member
FROM (
SELECT
m.id_msg
FROM {db_prefix}messages AS m
WHERE m.id_topic = {int:current_topic}
AND m.id_msg < {int:msg_before}
ORDER BY m.id_msg DESC
LIMIT {int:start}, {int:messages_per_page}) AS o
JOIN {db_prefix}messages as m ON o.id_msg=m.id_msg
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
ORDER BY m.id_msg DESC"

After

Code: [Select]
string(526) "
SELECT
m.subject, COALESCE(mem.real_name, m.poster_name) AS real_name, m.poster_time, m.body,
m.id_msg, m.smileys_enabled, m.id_member
FROM (
SELECT
m.id_msg
FROM {db_prefix}messages AS m
WHERE m.id_topic = {int:current_topic}
AND m.id_msg < {int:msg_before}
ORDER BY m.id_msg DESC
LIMIT {int:messages_per_page}) AS o
JOIN {db_prefix}messages as m ON o.id_msg=m.id_msg
LEFT JOIN {db_prefix} OFFSET {int:start} members AS mem ON (mem.id_member = m.id_member)
ORDER BY m.id_msg DESC"

The issue is your regex looks for the last } token, which in this case is the last db_prefix not the one on the same line. I'm not sure why the single line is being ignored.


Final edit:

Changing the s to a m seems to resolve the issue in this case.

Code: [Select]
$db_string = preg_replace('~\sLIMIT\s(\d+|{int:.+}),\s*(\d+|{int:.+})\s*(.*)$~im', 'LIMIT $2 OFFSET $1 $3', $db_string);

Last Edit: January 06, 2021, 11:38:10 am by tino

Re: ElkArte 1.1.7 Patch Testing

Reply #14

Well, darn!  Thank you for the extra testing!

I think we should back up a bit and try a simple single line capture and replace allowing for same line "stuff", including none, after the limit.  The old regex with the $ is probably just to greedy. Could you try this, it only has the case modifier and is only trying to find the limit code.

Code: [Select]
		$db_string = preg_replace('~\sLIMIT\s(\d+|{int:.+}),\s*(\d+|{int:.+}).*~i', 'LIMIT $2 OFFSET $1', $db_string);