Skip to content
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

Closed
phiamo opened this issue Jul 24, 2014 · 12 comments
Closed

cant have two times schema:text #112

phiamo opened this issue Jul 24, 2014 · 12 comments

Comments

@phiamo
Copy link
Contributor

phiamo commented Jul 24, 2014

when trying to use a rdf mapping with schema:text also for titles, js errors get thown:

Uncaught The editor instance "editor5" is already attached to the provided element. ckeditor_ckeditor_1.js:283
CKEDITOR.inline ckeditor_ckeditor_1.js:283
jQuery.widget.enable create_create_11.js:3069
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget._init create_create_11.js:2942
(anonymous function) create_jquery-ui_2.js:401
(anonymous function) create_jquery-ui_2.js:505
jQuery.extend.each create_jquery_1.js:648
jQuery.fn.jQuery.each create_jquery_1.js:270
$.fn.(anonymous function) create_jquery-ui_2.js:502
jQuery.widget.enablePropertyEditor create_create_11.js:901
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget._enablePropertyEditor create_create_11.js:791
(anonymous function) create_jquery-ui_2.js:401
(anonymous function) create_create_11.js:721
jQuery.extend.each create_jquery_1.js:648
jQuery.fn.jQuery.each create_jquery_1.js:270
jQuery.widget.findEditablePredicateElements create_create_11.js:707
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget.enable create_create_11.js:720
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget._doSetState create_create_11.js:696
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget.setState create_create_11.js:668
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget._init create_create_11.js:629
(anonymous function) create_jquery-ui_2.js:401
(anonymous function) create_jquery-ui_2.js:505
jQuery.extend.each create_jquery_1.js:648
jQuery.fn.jQuery.each create_jquery_1.js:270
$.fn.(anonymous function) create_jquery-ui_2.js:502
(anonymous function) create_create_11.js:476
jQuery.extend.each create_jquery_1.js:648
jQuery.fn.jQuery.each create_jquery_1.js:270
jQuery.widget._enableEdit create_create_11.js:442
(anonymous function) create_jquery-ui_2.js:401
jQuery.widget.setState create_create_11.js:209
(anonymous function) create_jquery-ui_2.js:401
(anonymous function) create_create_11.js:366
jQuery.event.dispatch create_jquery_1.js:3074
elemData.handle

is this a known limitation?

@phiamo phiamo changed the title cant have to times schema:text cant have two times schema:text Jul 24, 2014
@lsmith77
Copy link
Member

no .. seems like a bug :(

@dbu
Copy link
Member

dbu commented Jul 24, 2014

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 ?

@phiamo
Copy link
Contributor Author

phiamo commented Jul 24, 2014

what would i need to tell them, the is it also called schema in create.js?

@dbu
Copy link
Member

dbu commented Jul 24, 2014

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.

@dbu
Copy link
Member

dbu commented Aug 4, 2014

@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.

@phiamo
Copy link
Contributor Author

phiamo commented Aug 7, 2014

sry was at holidays, i just dont need howto title and enrich the issue there

@kolah
Copy link

kolah commented Nov 25, 2014

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?

@dbu
Copy link
Member

dbu commented Nov 25, 2014

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 ?

@kolah
Copy link

kolah commented Nov 25, 2014

Sure, I'll try to describe it as best as I can and create a PR by the end of the week :).

@lsmith77
Copy link
Member

ping :)

alternatively we could also automatically generate these subsets when using rdf mappings?

kolah pushed a commit to kolah/symfony-cmf-docs that referenced this issue Aug 24, 2015
Added info about using RDF property names multiple times – symfony-cmf/create-bundle#112
@kolah
Copy link

kolah commented Aug 24, 2015

Sorry, it took me eternity + 1 ;)

@dbu
Copy link
Member

dbu commented Aug 24, 2015

thanks a lot!

see symfony-cmf/symfony-cmf-docs#701

@dbu dbu closed this as completed Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants