Orchard.Core TextFieldDriver

Topics: Troubleshooting
Mar 15, 2013 at 11:55 AM
Hi,

i've noticed strange thing - text field named Note does not save changes when creating/editing content.

so i go to Orchard sources (Orchard 1.6)
\Orchard.Web\Core\Common\Drivers\TextFieldDriver.cs
to method
DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater, dynamic shapeHelper)
and i was surprised when i saw these lines:
 if(field.Name == "Note") {
                throw new ArgumentException();
            }
so, my question is - what are these lines for?
Developer
Mar 15, 2013 at 12:20 PM
I can't say why that was put there, but it is not there in the 1.x branch, so it will be gone in 1.7.
Coordinator
Mar 15, 2013 at 5:44 PM
I mentioned it in a meeting right after the release. It's my mistake ! I was testing some specific scenarios with exceptions, and used it to simulate one. Well I forgot to remove it before releasing. So 1.6 can't handle text fields named "Note" unless you patch your source code. It has been fixed in 1.x.
Developer
Mar 15, 2013 at 7:38 PM
Ah yes, I remember. I tend to forget other people's mistakes. I'm cool like that :)