Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12298
Latest: kancelariaszuster
New This Month: 8
New This Week: 0
New Today: 0
Stats
Total Posts: 39607
Total Topics: 6977
Most Online Today: 77
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 34
Total: 34

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

0 Members and 1 Guest are viewing this topic.

Offline Oldiesmann

  • SMF Gallery Pro Customer
  • Newbie
  • *****
  • Posts: 11
    • 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: 14832
    • 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: 11
    • 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

  • SMF Gallery Pro Customer
  • Newbie
  • *****
  • Posts: 11
    • 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: 14832
    • 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: 11
    • 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: 14832
    • 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
3204 Views
Last post June 07, 2007, 09:02:02 pm
by SMFHacks
7 Replies
5966 Views
Last post March 02, 2008, 08:17:45 pm
by SMFHacks
12 Replies
13409 Views
Last post August 18, 2008, 10:51:15 am
by gibbs
3 Replies
2632 Views
Last post December 31, 2008, 08:44:53 am
by SMFHacks
Few Issues

Started by shuban « 1 2 » Support

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

+- Recent Topics

[Mod] SEO Microdata Breadcrumbs by SMFHacks
March 22, 2019, 11:56:00 pm

Resizing by SMFHacks
March 22, 2019, 07:57:53 am

[Mod]Global Message Box by SMFHacks
March 19, 2019, 03:10:39 pm

condition de livraison by alain54100
March 17, 2019, 02:54:02 am

Redesign Work for SMF Store by alain54100
March 17, 2019, 02:50:32 am

Bulk upload image problem by alantani
March 14, 2019, 12:54:45 pm

German Translation missing in SMF 2.1R1 by SMFHacks
March 13, 2019, 07:08:19 pm

Gallery bug in 2.1 by SMFHacks
March 13, 2019, 08:32:32 am

Errors unstalling v7.2.1 by Ken.
March 11, 2019, 08:31:47 am

Pretty URLs and 2.1 by SMFHacks
March 07, 2019, 11:23:09 pm

Powered by EzPortal