Hello Guest


[SOLVED] [Forum] Bug on forum profile
Started by SpaceLapin
9 Replies    493 Views
SpaceLapin
  • Status:
    Offline
    Posts:
    8
[SOLVED] [Forum] Bug on forum profile
Hello, and long live Stray Fawn!

Little bug discovered while cheking @Philo's profile, on the last tab "Recent Posts":
Code: [Select]
Call to undefined function mysql_query()
Have a great day!
« Last Edit: August 12, 2017, 07:27:00 PM by SpaceLapin »

  • Read 493 times
  • Support
  • 9 Replies

Micha
  • Status:
    Offline
    Posts:
    13
Re: [Forum] Bug on forum profile
Thanks for the report  :)
I'll check it out and see if I can fix it!


SpaceLapin
  • Status:
    Offline
    Posts:
    8
Re: [Forum] Bug on forum profile
i assume the server is on php7, so the fix should be as simple as replacing calls to "mysql_query" with "mysqli_query" :)
(i have no doubt you'd have found that out on your own, but if i can save you some minutes.. ^^)


Philo
  • Status:
    Offline
    Posts:
    19
Re: [Forum] Bug on forum profile
Thanks SpaceLapin and welcome :)
\ ^_^ /


Micha
  • Status:
    Offline
    Posts:
    13
Re: [Forum] Bug on forum profile
i assume the server is on php7, so the fix should be as simple as replacing calls to "mysql_query" with "mysqli_query" :)
(i have no doubt you'd have found that out on your own, but if i can save you some minutes.. ^^)

Our version of SMF (2.0.14) should support PHP 7 and I've changed the db settings to use mysqli.
But it did not seem to work, I'll have to analyze it ^^


SpaceLapin
  • Status:
    Offline
    Posts:
    8
Re: [Forum] Bug on forum profile
Indeed SMF 2.0.14 is compatible with php 7, but none of the "mysql_" functions are (they've all been removed in 7.0)

I've downloaded SMF and checked the code, their database abstraction layer is pretty solid, and there shouldn't have any direct call to "mysql_query" anywhere -- the only thing i can imagine right now is that you installed a mod that doesn't use the integrated DB communication system as it should, and instead directly uses the mysql_ functions; is that a possibility?

(sorry if i'm bothering you, don't hesitate to tell me "we've got it under control, get lost buddy", i won't take it bad :p)


Micha
  • Status:
    Offline
    Posts:
    13
Re: [Forum] Bug on forum profile
Indeed SMF 2.0.14 is compatible with php 7, but none of the "mysql_" functions are (they've all been removed in 7.0)

I've downloaded SMF and checked the code, their database abstraction layer is pretty solid, and there shouldn't have any direct call to "mysql_query" anywhere -- the only thing i can imagine right now is that you installed a mod that doesn't use the integrated DB communication system as it should, and instead directly uses the mysql_ functions; is that a possibility?

(sorry if i'm bothering you, don't hesitate to tell me "we've got it under control, get lost buddy", i won't take it bad :p)

Haha no I'm happy for any help I can get!  :)
Mhh then I assume the culprit may be the theme we are using, because we only use a mod to integrate reCaptcha, and that should not cause the problems.

Edit: Yes the Theme is the problem, I've replaced mysql_query with mysqli_query. Now the error is gone but the recent posts are still not shown  ::)


« Last Edit: July 28, 2017, 02:28:11 PM by Micha »


SpaceLapin
  • Status:
    Offline
    Posts:
    8
Re: [Forum] Bug on forum profile
yeah if the theme is heavily relying on mysql_ functions, i'd assume that call to mysql_query isn't the only thing that needs replacement

the easy solution of course would be to use another theme fully compatible with php7, but if you want to keep this one, i'd be happy to take a look and try to point out what else needs changing, if you can tell me where to download it (i should have some free time over the week-end)


Micha
  • Status:
    Offline
    Posts:
    13
Re: [Forum] Bug on forum profile
I've sent you a message with the link.
Thanks alot for helping us fix this! :D


SpaceLapin
  • Status:
    Offline
    Posts:
    8
Re: [Forum] Bug on forum profile
this topic can be closed as the bug is fixed, but i've just discover another bug in the messaging system (the outbox) subforums system :p
i'll check it out sometimes next week ^^

EDIT: fix sent by PM :)
« Last Edit: August 12, 2017, 07:26:35 PM by SpaceLapin »