Forum

Home » support » General discussion » propel-dump-data/propel-load-data bug?
propel-dump-data/propel-load-data bug? [message #25566] Thu, 12 April 2007 18:10 Go to next message
east3rd  is currently offline east3rd
Messages: 50
Registered: April 2006
Member
Hi folks. I'm having an issue with dumping and loading data. I'm finding that if I've got a colon ( : ) in the value for a field, the loadData routine interprets it as an array, and the value that gets loaded for that field is simply the text "Array".

This only seems to be happening for single line entries in the fixtures yaml file that propel-dump-data generates. For example, the following would be problematic:
Event:
  Event_1:
    title: Radiohead: Live In Boston

Yet, the following works fine:
Event:
  Event_2:
    title: >
      Radiohead: Live In Boston

Furthermore, the following also works fine:
Event:
  Event_3:
    title: "Radiohead: Live In Boston"

Anyone come across this issue, and know a simple workaround (aside from writing a script that cleans up propel-dump-data's output)?
Re: propel-dump-data/propel-load-data bug? [message #25575 is a reply to message #25566 ] Thu, 12 April 2007 19:41 Go to previous messageGo to next message
marckohlbrugge  is currently offline marckohlbrugge
Messages: 163
Registered: January 2006
Senior Member
Looks like a YAML syntax related problem. Have you looked through the YAML documentation?
Re: propel-dump-data/propel-load-data bug? [message #25577 is a reply to message #25566 ] Thu, 12 April 2007 19:49 Go to previous messageGo to next message
halfer is currently online halfer
Messages: 6001
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I guess it depends where propel-dump-data comes from. If this is a symfony route that creates the YAML file, then raise a ticket here. Otherwise you may wish to post a message to the Propel mailing list to register the bug with them, if applicable.
Re: propel-dump-data/propel-load-data bug? [message #25582 is a reply to message #25577 ] Thu, 12 April 2007 20:34 Go to previous messageGo to next message
east3rd  is currently offline east3rd
Messages: 50
Registered: April 2006
Member
I guess part of my confusion is that I don't know exactly where the lines between Symfony and its included tools are drawn. For something like this, I don't know whose responsibility (symfony / propel / spyc) it is to prepare the data for dumping, and I'm sure that representatives from each of those parties would argue the point as well.

So for now, I've just added this awfully ugly hack to sfPropelData's dumpData():
    if (isset($values[$col]) && preg_match('/\:/', $values[$col]) && strlen($values[$col]) < 40) {
      $values[$col] = '"'.$values[$col].'"';
    }

It's obviously not ideal, but it's saving me a lot of headaches.
Re: propel-dump-data/propel-load-data bug? [message #25621 is a reply to message #25566 ] Fri, 13 April 2007 10:52 Go to previous message
halfer is currently online halfer
Messages: 6001
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I think you've answered the question as to whose responsibility it is: if it can be fixed in sfPropelData, then it is a symfony responsibility (note the "sf" prefix). I recommend you raise a ticket on this topic, if one does not exist already.
Previous Topic:[resolved] Table with a column named "class"
Next Topic:mixing symfony with non symfony code?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software