Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 177
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 185
Total: 185

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

0 Members and 1 Guest are viewing this topic.

Offline Oldiesmann

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

Started by shuban « 1 2 » Support

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

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal