X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fpart_virtual_field.html;h=401e527018d6368efbe8081091b975b34504aa54;hp=6a8008db7fb804aed69007bdd4908911dfff472e;hb=1fc8addc56f8daf12397da568eb1ac1b27fd3984;hpb=a7a22257d456394125eed32f8261c75a7f393ec2 diff --git a/httemplate/edit/process/part_virtual_field.html b/httemplate/edit/process/part_virtual_field.html index 6a8008db7..401e52701 100644 --- a/httemplate/edit/process/part_virtual_field.html +++ b/httemplate/edit/process/part_virtual_field.html @@ -1,6 +1,7 @@ <% include( 'elements/process.html', 'table' => 'part_virtual_field', 'viewall_dir' => 'browse', + 'message' => [ 'Your custom field has been created, but will not be available untill Apache has been restarted.=warning', ], 'precheck_callback' => sub { my ($cgi) = @_; $act = 'edit' if $cgi->param('vfieldpart'); @@ -25,11 +26,13 @@ $dbh->commit or die $dbh->errstr; # reload schema - my $dbdef_file = "/usr/local/etc/freeside/dbdef.".datasrc # XXX: fix this + my $dbdef_file = "/usr/local/etc/freeside/dbdef.".datasrc; my $dbdef = new_native DBIx::DBSchema $dbh; $dbdef->save($dbdef_file); - delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload - reload_dbdef($dbdef_file); + ## Stop reload of db schema as only reload current process and not others. Could be a pain to diagnose error. + ## Restart Apache to reload DB Schema for all. + #delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload + #reload_dbdef($dbdef_file); warn "cf add done schema modification, time=".time; } @@ -43,7 +46,9 @@ my $act = 'add'; ## make cgi->param("name") lowercase -$cgi->param('name' => lc $cgi->param('name')); +my $vcf_name = $cgi->param('name'); +$vcf_name =~ s/\s/_/g; $vcf_name =~ s/[^A-Za-z0-9\-_]//g; +$cgi->param('name' => lc $vcf_name); die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration');