Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4269
Latest: Gatux
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43594
Total Topics: 7568
Most Online Today: 128
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 68
Total: 68

Author Topic: Issues with SMF 2.1  (Read 5425 times)

0 Members and 1 Guest are viewing this topic.

Offline Oldiesmann

  • Member
  • *
  • Posts: 21
    • View Profile
    • Archie Comics Fan Forum
Issues with SMF 2.1
« on: November 02, 2018, 10:50:59 am »
Upgraded a site I help out with to SMF 2.1 last night and am working on setting up the gallery now, but keep running into issues...

First, the code is expecting the template file to be named Gallery2.template.php but the one that comes with it is Gallery2.1.template.php. Renaming this file fixes this issue.

The second more pressing issue is with the queries to show stuff. We're running MariaDB 10.0.36.

In the query beginning on line 659 of Gallery2.php, it complains about columns not being in "GROUP BY" until I add every column except m.real_name to the GROUP BY clause.

Once I get that done it finally displays the gallery but then I run into the same issues with the query for the recent comments ("'<database>.p.commenttotal' isn't in  GROUP BY"). I'm not sure exactly what the issue is, as I run SMF Gallery Pro on a different server (with MariaDB 10.2) without problems, though that's on SMF 2.0. I can get around that by simply not displaying most commented/recent items on the gallery index - attempting to add p.commenttotal to the GROUP BY clause doesn't seem to work (I just get that same error about p.commenttotal).

If I go to Gallery Stats, I get another error about 'm.real_name' not being in GROUP BY.
« Last Edit: November 02, 2018, 11:01:05 am by Oldiesmann »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16585
    • View Profile
Re: Issues with SMF 2.1
« Reply #1 on: November 02, 2018, 11:10:04 am »
For template issue it should have inserted a setting into the settings table "gallery_smfversion" and set it to 2.1 which is excuted on the dohooks.php
That will then make the systme choose to load the 2.1 template.

The group by issue is caused by this ONLY_FULL_GROUP_BY setting enabled in the database server
https://stackoverflow.com/questions/23921117/disable-only-full-group-by

https://blog.gabriela.io/2016/03/03/group-by-are-you-sure-you-know-it/

I attempt on install to detect it and then run this query and when the gallery is in use
SET sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''))




Can you attach your updated Sources/Gallery.php want to see the changes made. Will see if can those added.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Oldiesmann

  • Member
  • *
  • Posts: 21
    • View Profile
    • Archie Comics Fan Forum
Re: Issues with SMF 2.1
« Reply #2 on: November 02, 2018, 11:34:12 am »
The template issue seems to be that it sets "gallery_smfversion" to "2.1beta" instead of "2.1". If I change it to just "2.1" it works fine.

I can attach Gallery.php, but basically the changes to make it work with the FULL GROUP BY setting involve modifying queries with GROUP BY clauses and adding a bunch of columns to GROUP BY. I'll see if I can make SMF set the SQL mode for every query it runs so I don't have to do that.

Offline Oldiesmann

  • Member
  • *
  • Posts: 21
    • View Profile
    • Archie Comics Fan Forum
Re: Issues with SMF 2.1
« Reply #3 on: November 02, 2018, 11:48:46 am »
Did some more digging and it looks like SMF 2.1 is to blame here...

Code: [Select]
mysqli_query($connection, 'SET SESSION sql_mode = \'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\'');

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16585
    • View Profile
Re: Issues with SMF 2.1
« Reply #4 on: November 02, 2018, 11:54:47 am »
I see must be something new. MySQL 5.7 does have ONLY_FULL_GROUP_BY enabled by default.

I will make the 2.1beta beta fix and do a test on the latest SMF 2.1 from github.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Oldiesmann

  • Member
  • *
  • Posts: 21
    • View Profile
    • Archie Comics Fan Forum
Re: Issues with SMF 2.1
« Reply #5 on: November 02, 2018, 11:01:54 pm »
One more thing, not necessarily specifically related to SMF 2.1.

In the code to generate a tinyurl link for the image, it doesn't take into account that file_get_contents() doesn't work with URLs if the "allow_url_fopen" setting in php.ini is disabled. This is generating a couple of errors in my error log every time I view a photo (one because allow_url_fopen is disabled and one because "no suitable wrappers found"). On line 12355 of Gallery.php...

Find
Code: [Select]
if (function_exists('file_get_contents'))
Replace
Code: [Select]
if (function_exists('file_get_contents') && ini_get('allow_url_fopen') == 1)

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16585
    • View Profile
Re: Issues with SMF 2.1
« Reply #6 on: November 03, 2018, 12:00:12 am »
Thanks added to the next minor update.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/
Like Like x 1 View List

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
5024 Views
Last post December 31, 2008, 08:44:53 am
by SMFHacks
4 Replies
3850 Views
Last post June 12, 2010, 11:26:08 am
by mandomercs
1 Replies
3422 Views
Last post December 06, 2010, 07:29:19 pm
by SMFHacks
Few Issues

Started by shuban « 1 2 » Support

27 Replies
12937 Views
Last post June 03, 2012, 03:08:17 pm
by shuban
8 Replies
4516 Views
Last post November 06, 2019, 09:58:33 pm
by SMFHacks

+- Recent Topics

December 2024 Sale! by SMFHacks
December 02, 2024, 10:30:38 pm

Denying members some admin settings by rickk
November 17, 2024, 12:02:55 pm

Weird setup by SMFHacks
November 07, 2024, 06:37:41 am

Restoring a deleted photo by Monocero
November 01, 2024, 04:23:56 am

Gallery Pro reinstalation by Lirorobert
October 14, 2024, 01:43:43 am

Move picture from main gallery to user gallery by SMFHacks
October 11, 2024, 09:11:00 pm

quoting part of message by Lirorobert
October 04, 2024, 03:21:40 pm

Does SMF Gallery support by SMFHacks
October 02, 2024, 06:14:26 am

Item count on Gallery Tab shows double by SMFHacks
September 26, 2024, 12:59:20 pm

Forum post missing when image over 4000x pixels is uploaded to gallery by Michel68
September 24, 2024, 01:37:17 pm

Powered by EzPortal