-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cant have two times schema:text #112
Comments
no .. seems like a bug :( |
but it sounds like create.js is to blame. can you open an issue with the generated html output of the model in https://github.com/bergie/create ? |
what would i need to tell them, the is it also called schema in create.js? |
that is just a xml namespace alias. you should copy the html including namespace declaration, and the js code that mentions schema:text if there is any. |
@phiamo did you open an issue on create.js? if its not solved yet, lets link the issue so we can see where we are. |
sry was at holidays, i just dont need howto title and enrich the issue there |
I hadn't problems with JS while having multiple schema:text, but with document saving. It seems you can make subsets of generic properties, then editing is working as it should: <type xmlns:schema="http://schema.org/" typeof="schema:WebPage">
<children>
<property property="schema:headline" identifier="heading" />
<property property="schema:text/column1" identifier="column1" />
<property property="schema:text/column2" identifier="column2" />
<property property="schema:text/column3" identifier="column3" />
</children>
</type> Create.js sends property names as identifiers so if you have multiple properties with the same name strange things might happen. For example, PUT request without using subsets looks like this (despite that there are 3 properties using schema:text): {
"<http://schema.org/headline>": "headline content",
"<http://schema.org/text>": "<p>column2</p>",
"@subject": "</cms/studio>"
} Then every property matching schema:text in document is being overwriten with its last changed occurrence, resulting with 3 elements having the same content. {
"<http://schema.org/headline>": "headline content",
"<http://schema.org/text/column1>": "<p>column1</p>",
"<http://schema.org/text/column2>": "<p>column2</p>",
"<http://schema.org/text/column3>": "<p>column3</p>",
"@subject": "</cms/studio>"
} It took me some time to understand what is happening and how to overcome it. Nevertheless, I think it is created by design and is working properly. Maybe this issue is worth mentioning in the docs? |
i was not at all aware of this, great you found this solution! yes sure, this should go into the doc (actually the doc of create.js could also be better, this is mostly not specific to this bundle). do you want to add this towards the end in the metadata section on http://symfony.com/doc/master/cmf/bundles/create/introduction.html#metadata ? |
Sure, I'll try to describe it as best as I can and create a PR by the end of the week :). |
ping :) alternatively we could also automatically generate these subsets when using rdf mappings? |
Added info about using RDF property names multiple times – symfony-cmf/create-bundle#112
Sorry, it took me eternity + 1 ;) |
thanks a lot! |
when trying to use a rdf mapping with schema:text also for titles, js errors get thown:
is this a known limitation?
The text was updated successfully, but these errors were encountered: