Closed SergeC closed 9 years ago
This should be better:
$setValue = "<<<EOT $value EOT".PHP_EOL;
Please provide a patch and I will include it with pleasure.
I faced with the same issue. Can I make a patch?
@remedge Sure. Best way to do it with <<<
.
@Webonaute please check the PR https://github.com/Webonaute/DoctrineFixturesGeneratorBundle/pull/18
anyone can confirm the patch is working or create a unit test for it? I am little busy actually and dont have time to test it until this weekend.
Please provide also an example of text that was not working and now working with the patch.
For example, text containig double quotes - '<a href="http://github.com/">bla bla bla</a>'
I can provide unit test but little later.
@remedge thank. I appreciate!
Not tested but looks good.
@SergeC Sorry but I can't include a patch on a "it's look good" because it look good to mee too! but I dont want to include patch without at least 2 developer asserting its working after test or the patch author provide a proper unit test or I have personally tested it.
@Webonaute @remedge Tested, worked for me. $setValue = '<<<EOT' . PHP_EOL . $value . PHP_EOL . 'EOT' . PHP_EOL;
this works as well.
Added to master.
Some of my fields contain HTML and they are exported incorrectly when double quotes is in text. I've added
htmlentities
at line 263$setValue = '"' . htmlentities($value) . '"';
to\Webonaute\DoctrineFixturesGeneratorBundle\Tool\FixtureGenerator::generateFixtureItemStub