Handle the case of an empty field name when adding user profile fields. Fixes bug #11715.
This commit is contained in:
parent
fd153b80e9
commit
fd834a5384
3 changed files with 21 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
|||
- fixed #11621: Documentation Error: Methods that accept URLs should indicate whether or not to include Gateway
|
||||
- fixed #11457: Carousel broken
|
||||
- fixed #11455: Wrong use of Extras macro?
|
||||
- fixed #11715: "Empty" user profile fields: not in userProfileData / cannot delete
|
||||
|
||||
7.9.8
|
||||
- fixed #11651: First Day of Week is a string...
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use Getopt::Long;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Storage;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::ProfileField;
|
||||
|
||||
|
||||
my $toVersion = '7.9.9';
|
||||
|
|
@ -33,6 +34,7 @@ my $session = start(); # this line required
|
|||
# upgrade functions go here
|
||||
addIndexToUserSessionLog($session);
|
||||
addHeightToCarousel($session);
|
||||
synchronizeUserProfileTables($session);
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
|
@ -64,6 +66,23 @@ sub addHeightToCarousel {
|
|||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
sub synchronizeUserProfileTables {
|
||||
my $session = shift;
|
||||
print "\tMake sure that userProfileField, and userProfileData tables are aligned correctly... " unless $quiet;
|
||||
my $dbh = $session->db->dbh;
|
||||
my $fields = WebGUI::ProfileField->getFields($session);
|
||||
foreach my $field ( @{ $fields } ) {
|
||||
my $columnInfo = $dbh->column_info(undef, undef, 'userProfileData', $field->getId)->fetchrow_hashref();
|
||||
if (! $columnInfo) {
|
||||
printf "\n\t\tDeleting broken field: %s", $field->getId;
|
||||
$session->db->deleteRow('userProfileField', 'fieldName', $field->getId);
|
||||
}
|
||||
}
|
||||
|
||||
print " ...DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ sub create {
|
|||
|
||||
# Add the column to the userProfileData table
|
||||
$db->write(
|
||||
"ALTER TABLE userProfileData ADD " . $db->dbh->quote_identifier($fieldName)
|
||||
"ALTER TABLE userProfileData ADD " . $db->dbh->quote_identifier($id)
|
||||
. $dbDataType
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue