Commit e10c666
committed
Normalize line breaks for consistency with SQL
The data from the webpage gets submitted with CRLFs (`\r\n`). When this is submitted to a SQL XML column, however, the carriage return (`\r`) gets stripped. As such, when comparing the `AttributeBindingModel.Value` to the `AttributeRecord.Value`, these will never match if the content contains line breaks—_even if the text hasn't been modified_.
As a result, any page with e.g. an `HtmlAttribute` will always be marked `IsDirty()`, and always be `Save()`d. The `UpdatedTopic` stored procedure is smart enough to deduplicate the `ExtendedAttributes` field, but this still results in an orphaned version getting created due to the `LastModified` and `LastModifiedBy` fields being introduced.
This update normalizes the line breaks by first cleaning the `AttributeBindingModel.Value` to remove carriage returns (`\r`), thus standardizing it with the value in `AttributeRecord.Value`. As a result, a true apples to apples comparison can be made.
It's unclear when this issue was introduced. Regardless, this resolves #48.1 parent f354499 commit e10c666
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
| 448 | + | |
448 | 449 | | |
449 | 450 | | |
450 | 451 | | |
| |||
0 commit comments