Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    Kaste,

    Hope you can point me in the right direction ...

    I've added a new column to a table, but that column is simply not showing up in the show, add or edit forms. I've added the column in the _form.tpl file, only the header/label is showing up.

    Could be a caching issue (I've used Editam as my starting point).

    thanks!
    • CommentAuthorThijs
    • CommentTimeDec 27th 2007
     

    Are you sure you added the column in the _dev database? New columns should show up automatically in listing.tpl and show.tpl because those views use {loop content_columns}

    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    Thijs - thank you for pointing that out, will investigate.
    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    Thijs - wasn't that ...

    This is the code in _form.tpl for the table (the column not showing up is facebook_app):

    <p>
    <label for="camp_status">_{Status}</label><br />
    <%= input 'camp', 'status' %>
    </p>

    <p>
    <label for="camp_facebook_app">_{Facebook app}</label><br />
    <%= input 'camp', 'facebook_app' %>
    </p>

    And although I've added data to the field, it's not showing up on the listings page either.

    Surely one should be able to add columns manually? Using migrate/scaffold won't work for me, I'm made too many changes too views, etc
    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    One last thing, a side effect is that Add or Edit does not work - instead of being redirected back to "Show", one stays on the Add or Edit page, and not changes are made to database data.

    Could this be related to caching?
    • CommentAuthorKaste
    • CommentTimeDec 27th 2007 edited
     

    Surely one should be able to add columns manually?

    yes, this would be a nice feature. ;-)

    added columns show up in the listing/overview automatically.

    the form template must be modified manually or via script. (your posted form.tpl looks right BTW)

    Did you change the ->getContentColumns()-method? Try to narrow this a bit: Is the Model broken, the controller or the view?

    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    Kaste - I haven't touched getContentColumns ...
    • CommentAuthorKaste
    • CommentTimeDec 27th 2007
     

    Is the Model broken, the controller or the view?

    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    Difficult to say, the data field is not showing up on any form - sounds like a model or controller issue.
    • CommentAuthorKaste
    • CommentTimeDec 27th 2007
     

    sounds

    sounds like your a test driven development-guy. ;-)

    instantiate the Model. look what you get.

    Model->getAttributes();
    Model->getContentColumns();
    Model->getColumns();
    
    • CommentAuthornextstep
    • CommentTimeDec 27th 2007
     
    Kaste - seems as if that fixed the problem, thank you.

    It did not work 1st time round, I instantiated the model in the wrong source file.
Add your comments
    Username Password
  • Format comments as