-
Notifications
You must be signed in to change notification settings - Fork 43
Repository class name for ORM has slashes instead of backslashes because it's passed in the URL #65
Comments
this sounds strange. we played with this and it did work for us. do you have an idea at what point in the process the |
@dbu you are totally right, I think the best character is using the -, that will work in every browser and the fix would be in DoctrineOrmMapper in the function getBySubject, for chaning the - to an . I only don't know what the correct place is for changing the Repository tag before it is send via Javascript. Is it maybe a solutions for using class names like AcmeDemoBundle:Page instead of Acme/DemoBundleEntity/Page. That looks much cleaner to me.. |
looking at https://github.com/flack/createphp/blob/master/src/Midgard/CreatePHP/Mapper/DoctrineOrmMapper.php#L102 it seems to me we might have an issue with escape / unescape either not working or not being called. can you investigate that? if that is not enough, i would change lines https://github.com/flack/createphp/blob/master/src/Midgard/CreatePHP/Mapper/DoctrineOrmMapper.php#L57 and https://github.com/flack/createphp/blob/master/src/Midgard/CreatePHP/Mapper/DoctrineOrmMapper.php#L73 to replace |
Fixed issue: openpsa#65 This will change the createphp_attributes output to something like: xmlns:schema="http://schema.org/" typeof="schema:Page" about="Acme-DemoBundle-Entity-Page|id=1" And added the unescape for getBySubject class name.
@dbu I added a pull request for this issue which solves it. If you got feedback, let me know! |
fixed by 8627540 |
Hi there,
When using the Midgard\CreatePHP\MapperDoctrineOrmMapper, with the twig function createphp_attributes() will generate RDFA attributes like:
xmlns:schema="http://schema.org/" typeof="schema:Page" about="Acme\DemoBundle\Entity\Page|id=1"
That's ok, untill you want to save something via CreateJS..
The URL will change the Repository class name in : Acme/DemoBundleEntity/Page.
The fix for this could be in Midgard\CreatePHP\MapperDoctrineOrmMapper after this line:
#73 $class = ltrim($ids[0], '/'); // if we get the / from the url, this breaks the class loader in a funny way.
Putting this line.
#74 $class = str_replace('/', '', $class); // change slashes -> backslashes for the repository class
Is this an OK fix and should I commit it? Or should this problem be solved differently? (I also saw when passing the repository class name like AcmeDemoBundle:Page it also works).
I'm using:
"symfony/framework-standard-edition" 2.3.11
With the following extra bundles:
"symfony-cmf/create-bundle": "1.0.@dev",
"midgard/createphp": "0.9.@dev"
Thanks in advance!
The text was updated successfully, but these errors were encountered: