Related Links Field Saved As String Instead of XML
Hi,
Having a problem getting some fields to work in Umbraco 7.2.8 that used to be uComponents URL Picker fields. I'm almost completely done with an upgrade path all the way from 4.7.2 and this is my final issue! I've converted these fields over to the built-in "Related Links" data type, re-entered all the content and republished, but when I am attempting to show the values in XSLT I am getting nothing.
It's just a string though -- it's not actual XML -- so I can't parse the elements like I normally would in xPath. Seems to me there shouldn't even be these tags stored in there in the first place anymore now that it's not a URL Picker field. If I have to fix this in the database, what format is Related Links supposed to save in?
If I were to guess about this, I'd say that the "XML" you're seeing is the result of changing the property editor — have you tried changing the value (e.g. pointing to another page) and then saving the property? Does it change the XML string or does it switch to just an id, a CSV list of ids, or perhaps JSON?
Hey, thanks a lot, guys, for replying.... Chriztian! What up, man?!
I have an update. More bad news, sadly. As it turns out, these Related Links fields aren't saving to the database at ALL. I was fooled by Angular into thinking I was putting in values but if I navigate to another page and then come back, the fields are indeed empty.
What I am seeing on the front end in my <xsl:copy:of> is just the legacy/remnant data from the old uComponents URL Picker days.
Any ideas why these are not saving? There is no error. Log:
2015-09-17 09:10:58,761 [57] INFO Umbraco.Core.Publishing.PublishingStrategy - [P12112/T35/D4] Content 'Home' with Id '1055' has been published.
2015-09-17 09:11:02,816 [57] INFO umbraco.content - [P12112/T35/D4] Save Xml to file...
2015-09-17 09:11:02,889 [57] INFO umbraco.content - [P12112/T35/D4] Saved Xml to file.
Have you tried explicitly saving a different value? I've seen on several occasions that if I start filling in a field and the autocomplete kicks in, that I need to type every single letter for the change to actually kick in (if the value is the same as it was) - Angular seems to handle the autocompletion as "okay, he didn't change anything - we don't need to persist anything then".
If that's not the case, then you have some data-corruption on your hands, I guess :(
No matter what I did, I was just not able to get those values to overwrite -- autocomplete not the issue. So naturally, I decided to get off the lazy programmer couch and blow away the fields in the doctype utilizing this data type / property editor, save, re-create and re-save and... voila.
Thinking about leveraging the Multi Url Picker package instead now but the last time I installed that somewhere I remember it creating a million empty instances in my documents invoking it. You familiar with that weirdsie? I'll get a screenshot of it next chance I get.
Thanks again Chriztian -- you're always very helpful.
Related Links Field Saved As String Instead of XML
Hi,
Having a problem getting some fields to work in Umbraco 7.2.8 that used to be uComponents URL Picker fields. I'm almost completely done with an upgrade path all the way from 4.7.2 and this is my final issue! I've converted these fields over to the built-in "Related Links" data type, re-entered all the content and republished, but when I am attempting to show the values in XSLT I am getting nothing.
Existing code sample:
I don't know what to change the code to say here because when I write out a:
I get:
It's just a string though -- it's not actual XML -- so I can't parse the elements like I normally would in xPath. Seems to me there shouldn't even be these tags stored in there in the first place anymore now that it's not a URL Picker field. If I have to fix this in the database, what format is Related Links supposed to save in?
Ideas?
Thanks,
Garrett
Related links switched to returning JSON (specifically a JArray) when they moved to v7. I haven't worked with them in XSLT, but there's some documentation on how they work with MVC here: https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/related-links :)
Hi Garrett,
If I were to guess about this, I'd say that the "XML" you're seeing is the result of changing the property editor — have you tried changing the value (e.g. pointing to another page) and then saving the property? Does it change the XML string or does it switch to just an id, a CSV list of ids, or perhaps JSON?
/Chriztian
Hey, thanks a lot, guys, for replying.... Chriztian! What up, man?!
I have an update. More bad news, sadly. As it turns out, these Related Links fields aren't saving to the database at ALL. I was fooled by Angular into thinking I was putting in values but if I navigate to another page and then come back, the fields are indeed empty.
What I am seeing on the front end in my
<xsl:copy:of>
is just the legacy/remnant data from the old uComponents URL Picker days.Any ideas why these are not saving? There is no error. Log:
Weird, ha?
Here is the snippet inside that field in the cmsContentXml:
And again, it is not being overwritten in the database upon save/publish.
//Garrett
Yay :-)
Have you tried explicitly saving a different value? I've seen on several occasions that if I start filling in a field and the autocomplete kicks in, that I need to type every single letter for the change to actually kick in (if the value is the same as it was) - Angular seems to handle the autocompletion as "okay, he didn't change anything - we don't need to persist anything then".
If that's not the case, then you have some data-corruption on your hands, I guess :(
/Chriztian
Indeed.
No matter what I did, I was just not able to get those values to overwrite -- autocomplete not the issue. So naturally, I decided to get off the lazy programmer couch and blow away the fields in the doctype utilizing this data type / property editor, save, re-create and re-save and... voila.
Thinking about leveraging the Multi Url Picker package instead now but the last time I installed that somewhere I remember it creating a million empty instances in my documents invoking it. You familiar with that weirdsie? I'll get a screenshot of it next chance I get.
Thanks again Chriztian -- you're always very helpful.
//Garrett
is working on a reply...