Addons that add new fields need updating for cSQL 6.0

All notes and input on 2.0 Development are herein. <ul><li>Feature requests</li>
<li>Bug Reports</li>
<li>Beta Testing Feedback</li>
<li>Open Dev Discussion</li></ul>

Moderator: Coranto Moderator Team

Addons that add new fields need updating for cSQL 6.0

Postby Lawrence » Fri Mar 17, 2006 4:38 am

Hello,

I just wanted to coordinate a plan for bringing any addons that introduce new field types, or add their own news fields directly to the field arrays, up to speed with the current development release of CorantoSQL, as it cleans up some broken functionality ( assuming all new fields it doesn't know about should default to datatype VARCHAR(255) ) and returns field creation power back to the addons that started it :)

Unfortunately, this breaks some addons that haven't properly taken advantage of this feature in the past.

I will help anyone interested in bringing their addons up to speed.

Lawrence
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Lawrence » Fri Mar 17, 2006 4:41 am

First fix: vBulletin (3.x) Comments:

Add the following code to both 'vBComments_AlterCSQLTable' and 'vBComments_AlterCSQLTable_Pre' subs:

Code: Select all
$sql_add_field = "ALTER TABLE $CConfig{'CorantoSQL_tblname'} ADD vBComments_threadlink varchar(255);";
$corantosql_dbh->do($sql_add_field);
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Lawrence » Fri Mar 17, 2006 4:55 am

Reviewing things further, any addon that just directly patches a field into @fieldDB_internalorder (i know, a few of mine do this too) ideally needs to do two things:

1) Hook some SQL field creation code into CorantoSQL_AddAField. Mainly so cSQL's initial news transfer routine can setup the database table properly.

example
Code: Select all
$addon->hook('CorantoSQL_AddAField','vBComments_AlterCSQLTable_Pre',10);

sub vBComments_AlterCSQLTable_Pre {
# This is the one that is run during CorantoSQL setup
my $corantosql_dbh = &CorantoSQL_connectdb();

my $sql_add_field = "ALTER TABLE $CConfig{'CorantoSQL_tblname'} ADD vBulletin_threadid int(10)\;";
$corantosql_dbh->do($sql_add_field);

$sql_add_field = "ALTER TABLE $CConfig{'CorantoSQL_tblname'} ADD vBComments_ForumProfile varchar(255);";
$corantosql_dbh->do($sql_add_field);

$sql_add_field = "ALTER TABLE $CConfig{'CorantoSQL_tblname'} ADD vBComments_threadlink varchar(255);";
$corantosql_dbh->do($sql_add_field);

$corantosql_dbh->disconnect();
}


2) Add a link to it's settings that calls a page which does something similar to #1.
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am

Postby Feathers » Fri Mar 17, 2006 12:05 pm

Lawrence wrote:First fix: vBulletin (3.x) Comments:

Add the following code to both 'vBComments_AlterCSQLTable' and 'vBComments_AlterCSQLTable_Pre' subs:

Code: Select all
$sql_add_field = "ALTER TABLE $CConfig{'CorantoSQL_tblname'} ADD vBComments_threadlink varchar(255);";
$corantosql_dbh->do($sql_add_field);
Ooops! I realised yesterday that I should have done something like this when I added the new field.

Lawrence wrote:(i know, a few of mine do this too)
This was 'one of yours', I just hijacked it...do you want it back?
Mike
(Maintaining the vB3Comments addon)
Feathers
 
Posts: 110
Joined: Wed Jan 10, 2007 6:06 pm
Location: London

Postby Lawrence » Mon Mar 20, 2006 5:55 am

Not really, feathers :)

I think you are the best person to keep things as they are. I will simply submit patches back to you to fix things for cSQL 6.0. I am trying to bring every SQL-supporting addon up-to-speed because releasing the final 6.0 version.

Lawrence
Stuff I'm working on:
- nothing

Addons:
http://sourceforge.net/projects/lw-craddons/
Lawrence
 
Posts: 1524
Joined: Sun Sep 16, 2001 4:24 am


Return to Coranto 2.0 Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron