Question

I am using symfony 1.0 and admin generator is used for saving the news content. In configuration.yml file I see the below content:

generator:
  class:              sfPropelAdminGenerator
  param:
    model_class:      News
    theme:            default
    css:              admin

    list:
      title: News List
      display: [=vcheading, dtnewsdate, idfeednews]
      fields:
        vcheading: { name: News title }
        dtnewsdate: { name: News Date }
        idfeednews: { name: Feed reference }
      max_per_page: 20
      filters: [vcheading, idfeednews]

    edit:
      title: Add/Edit News
      display: [_category, _subcategory, vcheading, lvlongheading, vcsmallimageurl, itsmallimageheight, itsmallimagewidth, vclargeimageurl, itlargeimageheight, itlargeimagewidth, dtnewsdate, lvcontent, lvsummary]
      actions:
        _list: ~
        _save: -
      fields:
        #newscategorys: { name: News Category, type: admin_select_list, params: through_class=Newscategory }
        vcheading: { name: Heading }
        lvlongheading: { name: Long Heading }
        vcsmallimageurl: { name: URL (Small image) }
        itsmallimageheight: { name: Height ( S ) }
        itsmallimagewidth: { name: Width ( S )}
        vclargeimageurl: { name: URL (Large image)  }
        itlargeimageheight: { name: Height ( L ) }
        itlargeimagewidth: { name: Width ( L ) }
        dtnewsdate: { name: News live date, params: format='yyyy-MM-dd'}
        lvcontent: { name: Content, params: rich=true tinymce_options='plugins:"paste,spellchecker",theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,link,unlink,bullist,numlist,separator,undo,redo,separator,indent,outdent,spellchecker,pastetext,pasteword",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_statusbar_location:"none",elements:"news_lvcontent"' size=50x15 }
        lvsummary: { name: Summary, params: rich=true tinymce_options='plugins:"paste,spellchecker",theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,link,unlink,bullist,numlist,separator,undo,redo,separator,indent,outdent,spellchecker,pastetext,pasteword",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_statusbar_location:"none",elements:"news_lvsummary"' size=50x15 }

In 'newsAction' action file:

class newsActions extends autonewsActions {

    public function updateNewsFromRequest() {  
        parent :: updateNewsFromRequest();
    .
    .
    .
    .
    }

The class autonewsActions is seen in cache!!!

On pressing "Save" button

  • It goes to 'newsActions' action file and function 'updateNewsFromRequest' ( auto-generated by sfPropelAdmin) gets executed which is created in cache.
  • Here, under class 'autoNewsActions', function 'updateNewsFromRequest' is called and date format is set.

if input date format is '19-01-2013', value is getting set to '2019-01-2013'.

This is causing "Unable to parse date/time value for [dtnewsdate] from input" error.

Was it helpful?

Solution

Are you talking about this date field dtnewsdate?

It seems that you defined the wrong format inside the generator.yml. Try with this one:

dtnewsdate: { name: News live date, params: format='dd-MM-yyyy'}

Otherwise, you will have to set a date like 2013-01-19 to be valid if you don't want to update the format.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top