Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin settings error saving: null identifier #35

Open
kaide opened this issue Jan 28, 2013 · 3 comments
Open

admin settings error saving: null identifier #35

kaide opened this issue Jan 28, 2013 · 3 comments

Comments

@kaide
Copy link

kaide commented Jan 28, 2013

Hi I downloaded the source code from github(dated dec 3 2012)

I debug using vs 2012 and iis express and sql ce4; at admin->settings page there are 30 settings in the collection; If I do not touch the checkbox or textbox in the html form with mouse or tab, some Setting.Id will be 0, and throw the null identifier exception.

even after all the 30 settings has Id <> 0 after I touch the input form, I still get the null identifier exception.

firebug shown 3 javascripts error:
SyntaxError: syntax error
<!doctype html>
jquery...iVvaRE= (line 1)

SyntaxError: syntax error
<!doctype html>

settings (line 449)
ReferenceError: MiniProfiler is not defined

miniprofiler already set in web.config

Did I miss something?

error section:
Line 37: foreach (var setting in settings)
Line 38: {
Line 39: session.SaveOrUpdate(setting);
Line 40: }
Line 41: session.Flush();

Source File: ...\FunnelWeb-master\src\FunnelWeb\Model\Repositories\Internal\AdminRepository.cs Line: 39

@kaide
Copy link
Author

kaide commented Jan 29, 2013

I tried again with IIS server (not the express version) and I can succesfuly save the admin settings.

@kaide
Copy link
Author

kaide commented Feb 2, 2013

I think the session.SaveOrUpdate doesn't work;
I have to manually use session.Save and session.Update on the setting.

\src\FunnelWeb\Model\Repositories\Internal\AdminRepository.cs Line: 39

           //session.SaveOrUpdate(setting); 
           if (setting.Id == 0)
              session.Save(setting);
           else
              session.Update(setting);

@kaide
Copy link
Author

kaide commented Feb 2, 2013

sorry guys, ignore my previous comment; I am using sql ce 4.0 and this stackoverflow entry fix my problem; http://stackoverflow.com/questions/2361730/assertionfailure-null-identifier-fluentnh-sqlserverce

I added
.ExposeConfiguration(x => x.SetProperty("connection.release_mode", "on_close"))

in RepositoriesModule.cs

var databaseConfiguration = databaseProvider.GetDatabaseConfiguration(connectionStringProvider);
        var configuration =
            Fluently
                .Configure()
                .ExposeConfiguration(x => x.SetProperty("connection.release_mode", "on_close")) //for sql CE
                .Database(databaseConfiguration)
                .Mappings(m =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant