Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthornextstep
     
    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
     

    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
     
    Thijs - thank you for pointing that out, will investigate.
    • CommentAuthornextstep
     
    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
     
    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
     

    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
     
    Kaste - I haven't touched getContentColumns ...
    • CommentAuthorKaste
     

    Is the Model broken, the controller or the view?

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

    sounds

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

    instantiate the Model. look what you get.

    Model->getAttributes();
    Model->getContentColumns();
    Model->getColumns();
    
    • CommentAuthornextstep
     
    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.