Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12224
Latest: marcimila
New This Month: 8
New This Week: 0
New Today: 0
Stats
Total Posts: 39310
Total Topics: 6921
Most Online Today: 56
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 43
Total: 43

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

0 Members and 1 Guest are viewing this topic.

Offline Oldiesmann

  • SMF Gallery Pro Customer
  • Newbie
  • *****
  • Posts: 5
    • View Profile
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: 14683
    • 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

  • SMF Gallery Pro Customer
  • Newbie
  • *****
  • Posts: 5
    • View Profile
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

  • SMF Gallery Pro Customer
  • Newbie
  • *****
  • Posts: 5
    • View Profile
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: 14683
    • 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

  • SMF Gallery Pro Customer
  • Newbie
  • *****
  • Posts: 5
    • View Profile
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: 14683
    • 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
3159 Views
Last post June 07, 2007, 09:02:02 pm
by SMFHacks
7 Replies
5892 Views
Last post March 02, 2008, 08:17:45 pm
by SMFHacks
12 Replies
13179 Views
Last post August 18, 2008, 10:51:15 am
by gibbs
3 Replies
2546 Views
Last post December 31, 2008, 08:44:53 am
by SMFHacks
Few Issues

Started by shuban « 1 2 » Support

27 Replies
6893 Views
Last post June 03, 2012, 03:08:17 pm
by shuban

+- Recent Topics

Responsive Curve by pete
November 17, 2018, 04:10:59 am

SMF The Best of Theme Facebook is Here by SMFHacks
November 16, 2018, 11:37:43 pm

[Theme] SMF : Facebook Theme Beta Test by ittiphol
November 16, 2018, 10:08:56 pm

Fewer clicks to a download? by SMFHacks
November 14, 2018, 07:31:39 pm

SMFGalleryPro by SMFHacks
November 13, 2018, 04:52:08 pm

SMF Hacks Black Friday Sale! by SMFHacks
November 13, 2018, 11:17:24 am

error message from IPN by SMFHacks
November 11, 2018, 08:04:19 am

condition de livraison by SMFHacks
November 04, 2018, 12:36:49 pm

Issues with SMF 2.1 by SMFHacks
November 03, 2018, 12:00:12 am

banner visible only to admin by esoterico
November 02, 2018, 03:37:47 pm

Powered by EzPortal