Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 11839
Latest: BugginIn
New This Month: 2
New This Week: 0
New Today: 0
Stats
Total Posts: 42423
Total Topics: 7395
Most Online Today: 159
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 85
Total: 85

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

0 Members and 1 Guest are viewing this topic.

Offline Oldiesmann

  • SMF Gallery Pro Customer
  • Member
  • *****
  • Posts: 18
    • 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: 16086
    • 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
  • Member
  • *****
  • Posts: 18
    • 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
  • Member
  • *****
  • Posts: 18
    • 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: 16086
    • 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
  • Member
  • *****
  • Posts: 18
    • 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: 16086
    • 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
3871 Views
Last post December 31, 2008, 08:44:53 am
by SMFHacks
4 Replies
3019 Views
Last post June 12, 2010, 11:26:08 am
by mandomercs
1 Replies
2309 Views
Last post December 06, 2010, 07:29:19 pm
by SMFHacks
Few Issues

Started by shuban « 1 2 » Support

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

+- Recent Topics

Custom badges by Hatshepsut
Today at 10:10:46 pm

Membergroup level by davejo
Today at 02:13:49 am

Setting a single free download. by SMFHacks
August 16, 2022, 09:50:04 am

Quick moderation checkboxes in search result? by SMFHacks
August 08, 2022, 10:37:03 am

Contact Page Mod Not Working by SMFHacks
August 05, 2022, 12:19:43 pm

Issues with new Newsletter Pro installation by SMFHacks
August 05, 2022, 07:15:18 am

SMFBlog Mod by Nicole
August 03, 2022, 09:46:22 pm

Contact Page by Nicole
August 03, 2022, 09:45:42 pm

trader + classifieds by Nicole
August 03, 2022, 05:05:17 pm

Category Permissions List by SMFHacks
July 30, 2022, 07:53:24 am

Powered by EzPortal