NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!


SimplePortal

SimplePortal's bugs.

Bug Issue: Use of "General" collation on Simple Portal tables not always correct

Pages: [1]   Go Down

Offline AngelinaBelle

  • Support
  • *
  • Posts: 4885
  • Gender: Female
« on: December 06, 2011, 08:22:16 am »
In both install2.php and install1-1.php, an attempt is made to get collation right for UTF8 forums.
But in each of those cases, the collation is GENERAL (utf8_general_ci).
But not all SMF forums use general collation. Many forum owners prefer collation that better suits the primary language of their forum.
Is there some way to find out which collation is being used, for example, in the smf_members table, and use that for the columns on the simpleportal tables?
Please see an example of this problem at:
http://simpleportal.net/index.php?topic=10311.0
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6613
  • The Amazing Coder!
« Reply #1 on: February 22, 2012, 10:04:45 am »
I really don't want us to deal with this issue. Getting the collation of a column might get messy. What I'm thinking is making sure the installer fallbacks to SMF, completely and blame SMF for the rest. Though I can code a tool to fix this, to help with support, which may work only in some cases due to limitations put by hosts.
And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6613
  • The Amazing Coder!
« Reply #2 on: February 23, 2012, 07:33:21 am »
! Make sure installation completely relies on SMF functions for collation.

Commit: 08a3085e8cd419d6d3b14c3ed653df725e44c051
And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6613
  • The Amazing Coder!
« Reply #3 on: February 23, 2012, 07:33:38 am »
I'll get the tool ready too, as soon as possible.
And slowly, you come to realize... It's all as it should be...

Offline Underdog

  • Support
  • *
  • Posts: 917
  • Gender: Male
  • On Hiatus
    • WebDev
« Reply #4 on: March 01, 2012, 06:36:25 pm »
If I understand the issue correctly, you need to adjust SP table collations in the installer to reflect what the rest of the SMF table installation is set to.
Is this correct?

Why not just create a small routine at the bottom end of the SP installer & use 1 of the main SMF tables as a reference?

ie.
Code: [Select]
function SP_set_collations()
{
global $smcFunc;
$sp_tables = array('sp_articles', 'sp_blocks', 'sp_categories', 'sp_functions', 'sp_pages', 'sp_parameters', 'sp_shoutboxes', 'sp_shouts');

$result = $smcFunc['db_query']('', "SHOW FULL COLUMNS FROM {db_prefix}settings");
while ($val = $smcFunc['db_fetch_assoc']($result))
$collation = $val['Collation'];

$smcFunc['db_free_result']($result);

foreach ($sp_tables as $sp_table)
$alterTable = $smcFunc['db_query']('', "ALTER TABLE {db_prefix}{$sp_table} COLLATE {$collation}");
}

SP_set_collations();

.. or let people with the issue just put the above in a php block & preview it.


« Last Edit: March 01, 2012, 08:53:00 pm by Underdog »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6613
  • The Amazing Coder!
« Reply #5 on: March 02, 2012, 02:10:20 pm »
Yeah, that's what I'm going to do with the tool I was talking about.
And slowly, you come to realize... It's all as it should be...

Pages: [1]   Go Up

Issue Changes

Change Member Time
Status changed from Assigned to Resolved [SiNaN] February 23, 2012, 07:33:21 am
Status changed from New to Assigned [SiNaN] February 22, 2012, 10:04:45 am
Issue Assigned from (none) to [SiNaN] [SiNaN] February 22, 2012, 10:04:45 am

Issue Details

  • Reported
    December 06, 2011, 08:22:16 am
  • Updated
    March 02, 2012, 02:10:20 pm
  • View Status
    Public
  • Type
    Bug
  • Status
    Resolved
  • Priority
    Normal
  • Version
    2.3.4
  • Fixed in
    (none)
  • Assigned to
    [SiNaN]
  • Category
    Error

Tags



Powered by: SMF Project Tools 0.5.4 © Niko Pahajoki 2007-2011