Thanks for the replies. I've checked in the DCA file and it is as it appears above, with "'unique'=>true" set, so as you say it should be unique from this perspective. But when I check in the database backend it's not set to unique. If my understanding of typolight is correct then the database.sql file should have a line in it which sets the value in the database (and not just the DCA) to unique.
Here's what tl_user looks like and you can see that the username (for a user) is set to unique in the database -
Code:
CREATE TABLE `tl_user` (
`id` int(10) unsigned NOT NULL auto_increment,
`tstamp` int(10) unsigned NOT NULL default '0',
...SNIP...
`currentLogin` int(10) unsigned NOT NULL default '0',
`lastLogin` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Here's what tl_member looks like and there is no corresponding 'UNIQUE' entry at the bottom -
Code:
CREATE TABLE `tl_member` (
`id` int(10) unsigned NOT NULL auto_increment,
`tstamp` int(10) unsigned NOT NULL default '0',
...SNIP...
`currentLogin` int(10) unsigned NOT NULL default '0',
`lastLogin` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
So, I reckon the problem here is that the line should be
UNIQUE KEY `username` (`username`)
with the result that the database field is marked as unique, but I am not familiar enough with how typolight hangs together to be sure that this is definitely correct.
I'm happy enough to add the change into my config, but if it is actually a bug I'll flag it up wherever the official place is if someone points me in the right direction.
I'm still a little mystified as to how my forms made it past the 'unique' setting in the DCA though. I can only guess that somehow the DCA isn't being applied to the data in the form that I created. I know that the fields are being updated in the database no problem and appear when I go into the member list in typolight, complete with non-unique usernames.
z
Bookmarks