OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Field Link.Edit.cshtml problem with migration #7374

Open FinnMacCumail opened 7 years ago

FinnMacCumail commented 7 years ago

Upon writing a custom module that uses the following Field migration -

`.WithField("LinkButton", cfg => cfg.OfType("LinkField")
                    .WithDisplayName("Button URl Link"))

The Link.Edit template renders the error - Compiler Error Message: CS0103: The name 'isRequired' does not exist in the current context

If I include the following line of code from commit be323ab, the code runs fine?

var isRequired = settings.Required && String.IsNullOrWhiteSpace(settings.DefaultValue);

sebastienros commented 7 years ago

What version are you using? Do you actually have a custom Link.Edit.cshtml file? You should have both changes if you didn't do anything special with this file.

FinnMacCumail commented 7 years ago

I'm using Orchard v.1.10.1.0

Viewing the git history of the files Link.edit.cshtml - the last commit f51c8a72 does not define the var IsRequired?

agriffard commented 7 years ago
var isRequired = settings.Required && String.IsNullOrWhiteSpace(settings.DefaultValue);
var isTextRequired = settings.LinkTextMode == LinkTextMode.Required && String.IsNullOrWhiteSpace(settings.TextDefaultValue);

It has been lost during this merge on dev : https://github.com/OrchardCMS/Orchard/commit/c8a4def111065c5bb2039638ce9507604ab51e55

benschi11 commented 7 years ago

Is someone on this issue? I fixed it for my own Orchard installation. Should I make a pull request?