FIXED: Formatters in v1.0 not working as expected

edited November 2012 in Bug Reports
Building a news module using FUEL 1.0 and I'm not seeing the Model Formatter functions behave in the manner I would expect.

My DB table has field
`date_added` date NOT NULL default '0000-00-00',

in application/config/MY_config.php
// date format used with date helpers $config['date_format'] = 'm/d/Y'; $config['date_format_verbose'] = 'F j, Y'; $config['time_format'] = 'g:ia';

In my view:
// get the article requested $article = fuel_model('articles', array('find' => 'one', 'where' => array('slug' => $slug) ) ); echo $article->date_added_formatted;

this outputs: 2012-11-06 when I expect to get 11/06/2012

Also, when trying to debug this I had log messages in fuel/modules/fuel/helpers/MY_date_helper.php in the date_formatter() function. These never appear in the logs, so I suspect the call chain is borked somewhere along the line.

I am having a similar issue with the {string_field}_formatted functions, which are not outputting the string wrapped in

tags as is documented.


  • edited 3:04AM
    Is this with the latest pull from the repo?
  • edited 3:04AM
    My last pull from the 1.0 branch was on 11/1 --- so that would be SHA: 055a2d993f8faa8.

    I'll pull in the latest commit, the branch merge SHA: 4078f2e089a9fe1 and test again.
  • edited 3:04AM
    That pull should have worked OK too. Would you mind posting your model and SQL or you can email it to me (address is on my forum profile page).
  • edited 3:04AM
    In order to keep the forum clean I have sent an email with a single file which includes the SQL for my table, the Model, and relevant snippet of the view file, along with generated output. I have marked the view file and output with '<===' markers to identify the function calls and resulting output which are in question.

    Thank you for your attention to this.
  • edited 3:04AM
    I've posted a fix for this in the repo. Thanks
  • edited 3:04AM
    To close the loop: Thanks, SHA 132c1149e006d1f26 fixed the issue.

    Topic Headline modified to indicate this was solved.

Sign In or Register to comment.