-
Notifications
You must be signed in to change notification settings - Fork 54
Fieldset Labels Don't Sanitize Rich Text Immediately #428
Comments
Yep, confirmed. We should probably fix that. |
I just tried again but this time with the |
|
I'll try to look into this tonight, but I've got a busy week, so might have to wait until next week. Hopefully it's a quick fix though (may be since it's pretty easy to reproduce). |
Note to self, look into |
I suspect the issue may be this line: https://github.com/kgiszewski/Archetype/blob/master/app/services/archetypeLabelService.js#L494 On the first run, it would return null for the data type info, and so the subsequent if statement would never be entered into, which means I have a couple fixes in mind. One would be to add an optional parameter to Hopefully I can find time to submit a pull request tonight. |
👍 no rush |
…kgiszewski#428 Also, more robust handling of the growing array of promises.
Currently working off of this branch: https://github.com/Nicholas-Westby/Archetype/tree/fix/428-label-sanitization I think I've fixed it (I've pushed to that branch too), but I haven't done much testing yet, so I'll hold off on the pull request for now. |
I've fixed this one and it was data type caching related, however #429 still needs it's own fix. I will look at that in the morning. |
I think the fundamental problem we're seeing is cache related. Entity\datatype lookups are missing on the first try. The cache gets populated quietly in the background, then the second try is a cache hit. I've preloaded all of the datatypes but I can't do that for entities. The original label templates were designed to run rapidly and hence the cache was needed to prevent http spam. I'm trying to wrap my head around the current state more. I'm surprised I didn't catch this in testing. We'll figure something out. I might need to rewrite the 'built-ins' to be promises. |
If we can rewrite the built-ins as promises, the solution is pretty easy. Just didn't want to do that, as it may break backward compatibility. |
As I count the number of hours I've put in on this today, I'm leaning towards that :) |
I think i got it all working, would love a peer review when you get a chance. https://github.com/kgiszewski/Archetype/pull/431/files?w=1 I tried 1001 things and finally landed on one that seems to work without any breaking changes. tl;dr => caching woes |
Oh and I tested @kipusoep 's template, the native template for RTE and I will test a promise tomorrow (it's late here). |
Closing as a result of #431 |
Just upgraded to 1.6.0 and noticed this:
Notice the rich text isn't sanitized (i.e., the markup is still there). If I expand the fieldset, the digest cycle runs again and causes it to be sanitized. Here's what that looks like (I happened to collapse the fieldset again in this screenshot):
IIRC, the label template is something like this:
The "Header" field is rich text.
Probably related to that recent change I made for promises.
The text was updated successfully, but these errors were encountered: