I'm a bit fearful the caption at the time of submitting is stored in the entry, that way, changing a caption afterwards would not result in a solution.
In any case, changing the caption from "CV (PDF)" to CV in the form designer and next using record.cv still yields an exception... :s
The binaries could be updated to truly strip out all non-alphanumerics I guess (as stated in the docs).
Did a quick test. The regex used doesn´t filter out the spaces I´m afraid.
Also, I did a quick reflektor on the modified binary and it seems the regex is instantiated but not used in Trygetmember... in fact, it seems TryGetMember is entirely broken, even for simple captions. It seems the actual selection is never executed:
Would it be safe to edit the values in the column "caption"in dbo.UFFields manually? Or will that destroy the entire coherence of the stored records in some way?
On the other hand, is it the case that the dynamic records are somehow deserialized from dbo.UFRecordsXML? Captions seem to be hard-coded there...
As it stands I have 3 captions with offending characters and people are pushing me to come up with a quick fix so that would buy me some time for a more robust fix in the binaries...
SO no need to mess with db just use the recordfields to fetch it :) will look into improving the dynamic stuff a bit later today but the snippet should do the trick
For anyone following this thread, using the non-dynamic approach works. However, since DynamicRecord cannot be cast to Record, the initial collection of records should be retrieved as follows:
RecordStorage rStor = new RecordStorage();
@foreach (Record record in rStor.GetAllRecords(new Guid("someguid-as-string")))
Whereas before you could use:
@foreach (dynamic record in Umbraco.Forms.Mvc.DynamicObjects.Library.GetRecordsFromForm("someguid-as-string"))
Otherwise, using a lambda expression as follows will not sit well with the use of dynamic:
I don't wish to be annoying but somehow, proper cleanup of dynamic properties on DynamicRecord is still not implemented...
In my post of November 25, 2013 @ 11:51 I mention that you instantiate a Regex in TryGetMember but you are not actually using it.
This is still the case in the .19 version of Contour.
Normally I wouldn't complain too much if this was open source code and I could fix this but this problem is making me have to use ugly workarounds in my code and holding back some of my work. This functionality is in a key part of the code for manipulating records.
Could you maybe look at getting this patched up? Contour is a paying product after all ;)
I would love to join for the event in Belgium because I'm thinking of stepping up my web development activities with Umbraco as the foundation but unfortunately I'll be abroad for my day job at that time :(
Any news on this? My work relies heavily on being able to handle and display form entries all over my site and the fact that this essential feature has been broken for so long is starting to become a bit bothersome as the size of my website increases.
Dealing with captions in dynamic .notation
Say I have a form with a field that has the caption:
Preferred position (1st choice)
When trying to get the value of this field using the . notation according to the Contour developer docs it should be accessible as:
i.e. omitting any spaces and non-alphanumerics.
For some reason however, this does not work? Better to change the caption altogether?
Comment author was deleted
Hmm can you get rid of the 1 so try record.Preferredpositionstchoice
I'll share the snippet that is used so you have a better idea :)
Comment author was deleted
It's trying to do this
_record.RecordFields.Where(f => f.Value.Field.Caption.Replace("#", "").Replace(" ", "").ToLower() == name.ToLower())
so just getting rid of the spaces should do it
Hi Tim,
I think I might have a problem then.
I have captions like these:
"CV (PDF)" "Preferred Position (1st Choice)"
() are a problem of course
In hindsight maybe not the best idea but I'm stuck with it now.
I'm under the impression that changing the caption also does not yield improvement. So e.g. changing CV (PDF) to CV does not seem to work either.
I have loads of entries now and I'd still like to display them without losing data :)
I'm a bit fearful the caption at the time of submitting is stored in the entry, that way, changing a caption afterwards would not result in a solution.
In any case, changing the caption from "CV (PDF)" to CV in the form designer and next using record.cv still yields an exception... :s
The binaries could be updated to truly strip out all non-alphanumerics I guess (as stated in the docs).
Or am I still missing something?
Comment author was deleted
Yup will look at a solution :) that also removes those chars!
stay tunes solution will arrive today or early next week (and you will lose no data)
Thanks Tim,
Would you say that risking a direct edit in the SQL DB would be worth it?
Cheers,
Kris
Comment author was deleted
Nah don't do that, I'll just make the dynamic stuff strip out all illegal chars
Something like
?
:)
Hey Tim,
Do you have an ETA on a potential hot fix?
I'd be happy to do some testing if need be.
If you are awfully busy I might be tempted to do a DB edit anyway.
Cheers,
K.
Comment author was deleted
Yup fix will be available today :) eta 15:00
Perfect!
Comment author was deleted
Fixed, please download the update zip http://nightly.umbraco.org/Umbraco%20Contour/3.0.18%20WIP/ and then just deploy the Umbraco.Forms.Mvc assembly (if you are running 3.0.17)
Hi Tim;
Did a quick test. The regex used doesn´t filter out the spaces I´m afraid.
Also, I did a quick reflektor on the modified binary and it seems the regex is instantiated but not used in Trygetmember... in fact, it seems TryGetMember is entirely broken, even for simple captions. It seems the actual selection is never executed:
Could it be something was overlooked?
The regex should be applied and additionally spaces need to be stripped from caption and this should be compared to the supplied name...
I´m in a bit of a pickle because of this issue :)
Comment author was deleted
Ok cool taking another look now
Hi Tim,
Anything yet? :)
Cheers,
Kris
Hey Tim,
As a temporary fix on 3.0.17...
Would it be safe to edit the values in the column "caption"in dbo.UFFields manually? Or will that destroy the entire coherence of the stored records in some way?
On the other hand, is it the case that the dynamic records are somehow deserialized from dbo.UFRecordsXML? Captions seem to be hard-coded there...
As it stands I have 3 captions with offending characters and people are pushing me to come up with a quick fix so that would buy me some time for a more robust fix in the binaries...
Cheers,
Kris
Comment author was deleted
Ah sorry had to do some other stuff yesterday, but as a workaround just fetch it non dynamic , will post a snippet in a minute
Comment author was deleted
yourDynamicRecordobject.RecordFields.Where(f => f.Value.Field.Caption == "YourCaption").First().Value.ValuesAsString()
Comment author was deleted
SO no need to mess with db just use the recordfields to fetch it :) will look into improving the dynamic stuff a bit later today but the snippet should do the trick
For anyone following this thread, using the non-dynamic approach works. However, since DynamicRecord cannot be cast to Record, the initial collection of records should be retrieved as follows:
Whereas before you could use:
Otherwise, using a lambda expression as follows will not sit well with the use of dynamic:
Notations are a bit unwieldy so the dynamic route is still preferred/faster...
Comment author was deleted
COol thank for the details, will solve the dynamic stuff this week
Hi Tim,
Are these issues fixed in the newest (.18) version?
Hi Tim,
Were you finally able to roll a fix into the latest release?
Hey Tim,
I don't wish to be annoying but somehow, proper cleanup of dynamic properties on DynamicRecord is still not implemented...
In my post of November 25, 2013 @ 11:51 I mention that you instantiate a Regex in TryGetMember but you are not actually using it.
This is still the case in the .19 version of Contour.
Normally I wouldn't complain too much if this was open source code and I could fix this but this problem is making me have to use ugly workarounds in my code and holding back some of my work. This functionality is in a key part of the code for manipulating records.
Could you maybe look at getting this patched up? Contour is a paying product after all ;)
Cheers,
Kris
Any news?
Small bump... Isn't anybody else seeing this issue pop up????
Comment author was deleted
Oops forgot about this one, looking into it now
btw will I see you at http://umbracobefestival.be/ ?
No problem :) Busy times for everyone I think.
I would love to join for the event in Belgium because I'm thinking of stepping up my web development activities with Umbraco as the foundation but unfortunately I'll be abroad for my day job at that time :(
Hello Tim,
I just checked out Contour .21
It seems, now, the regex filtering is happening but there is still one remaining oversight: spaces are not filtered from the captions.
As far as I can tell, the relevant line in TryGetMember(...) is following:
and subsequently:
I did not check GetMemberBinder (which I think is new) but if I already test these lines in a small test:
}
I get the output:
I therefore think the regex has a space where it should not (after the 9):
This produces the desired output (i.e. strings that can actually be used to access record fields...
It would be really great if you could fix this in one of the nightlies...
Just a small reminder :)
Hi Tim,
Any news on this? My work relies heavily on being able to handle and display form entries all over my site and the fact that this essential feature has been broken for so long is starting to become a bit bothersome as the size of my website increases.
Cheers,
Kris
Hello Tim,
I hate to keep being annoying :), but any chance a fix for CON-558 could be included in a nightly release or something?
Cheers,
Kris
Has this been fixed and can this be added to 3.0.7
is working on a reply...