Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#17 [svn] Crash adding security to portfolio.

closed-fixed
Portfolio (43)
5
2006-07-24
2006-07-24
Anonymous
No

Message: Pre-Condition of function virtual libawf::record& libawf::dataview::record_type() was violated, expression: _dob != NULL.
File: dataview.cc
Line: 58
Function: virtual libawf::record& libawf::dataview::record_type()
Stack Trace:
#1 [0x826dfc7]
#2 [0x826d7d8]
#3 [0x82c0675]
#4 [0x82f3980]
#5 [0x82f8999]
#6 [0x8333112]
#7 [0x82817f9]
#8 [0x82ac488]
#9 [0x8266798]
#10 [0x826b141]
#11 [0x8063526]
#12 [0x859354a]
#13 [0x8048131]

Version: svn
Contact: mswilliamson@uwaterloo.ca

Discussion

  • Logged In: YES
    user_id=1281708

    This was an error with the change to allow shared
    portfolios. It is corrected in svn commit #180.

    Index: src/libawf/webprocess.cc

    --- src/libawf/webprocess.cc (revision 177)
    +++ src/libawf/webprocess.cc (working copy)
    @@ -43,6 +43,7 @@
    {
    std::stringstream page;

    + initialize_page(pset);
    render( pset, page );

    write_headers(ouput);
    @@ -149,3 +150,7 @@
    {
    _compression_off = true;
    }
    +
    +void
    libawf::web_process::initialize_page(libawf::parameter_set&
    pset)
    +{
    +}
    Index: src/libawf/webprocess.h
    ===================================================================
    --- src/libawf/webprocess.h (revision 177)
    +++ src/libawf/webprocess.h (working copy)
    @@ -40,6 +40,12 @@

    protected:
    virtual void render(parameter_set& pset, std::ostream&
    output) = 0;
    +
    + /**
    + * Called before any work is done, suitable for
    setting global
    + * parameters.
    + */
    + virtual void initialize_page(libawf::parameter_set&
    pset);

    protected:
    std::string get_cookie(const std::string& name) const;
    Index: src/src/portfolioview.h
    ===================================================================
    --- src/src/portfolioview.h (revision 177)
    +++ src/src/portfolioview.h (working copy)
    @@ -69,6 +69,7 @@
    virtual void preview_done();
    virtual libawf::data_object* get_data_object();
    virtual void begin_grid(const libawf::parameter_set&
    pset);
    + virtual void initialize_page(libawf::parameter_set&
    pset);

    private:
    void validate(libawf::record& rec,
    libawf::parameter_set& pset);
    Index: src/src/portfolioview.cc
    ===================================================================
    --- src/src/portfolioview.cc (revision 177)
    +++ src/src/portfolioview.cc (working copy)
    @@ -59,6 +59,10 @@

    void portfolio_view::begin_grid( const
    libawf::parameter_set & pset )
    {
    +}
    +
    +void
    portfolio_view::initialize_page(libawf::parameter_set& pset)
    +{
    if( pset.is_set("id") )
    {
    _portfolio_id = pset["id"];
    @@ -82,6 +86,7 @@
    {
    parent().get_database().close(da);
    _portfolio_id = rec.get_value("portfolios.id");
    + set_cookie( libawf::cookie("portfolio-
    id",libawf::convert_to_string(_portfolio_id)) );
    }
    }
    }
    @@ -109,11 +114,12 @@
    portfolio_datafile* df = new portfolio_datafile;
    df->set_uid( _uid );
    set_data_object( df );
    +
    + set_page_title( "Portfolio" );
    }

    void portfolio_view::setup_grid(libawf::parameter_set&
    pset)
    {
    - set_page_title( "Portfolio" );
    hide_column("portfolio.id");
    hide_column("portfolio.portfolio_id");
    hide_column("portfolio.flags");
    @@ -157,7 +163,6 @@
    void portfolio_view::begin_append( libawf::parameter_set &
    pset )
    {
    set_page_title( "Edit Portfolio" );
    - _portfolio_id = pset["pfid"];
    }

    void portfolio_view::validate_new_record( libawf::record &
    rec, libawf::parameter_set & pset )
    @@ -216,7 +221,6 @@

    libawf::internal_link ladd = parent().link_to(*this);
    ladd.add_parameter( "action", "append" );
    - ladd.add_parameter( "pfid", _portfolio_id );
    sidebar->add_menu_item( "Add Security", ladd );

    sidebar->add_menu_item( "Permissions",
    parent().link_to("portfolio-permissions") );
    @@ -459,7 +463,7 @@
    {
    libawf::internal_link lk = parent().link_to( *this );
    lk.add_parameter( "action", "display" );
    -// lk.add_parameter( "id",
    rec.get_value( "portfolio.portfolio_id" ) );
    + //lk.add_parameter( "id",
    rec.get_value( "portfolio.portfolio_id" ) );
    return lk;
    }

     
    • labels: --> Portfolio
    • milestone: --> Version 0.2.0 Pre-release
    • assigned_to: nobody --> mwilliamson
    • status: open --> closed-fixed