Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/maxlengthsetting #8719

Merged

Conversation

AgostiniAlessandro
Copy link
Contributor

Implemented what was described in the #8718 issue

@@ -1,10 +1,16 @@
@using Orchard.Utility.Extensions;
@{
string editorFlavor = Model.EditorFlavor;
var htmlAttributes = (Dictionary<string, object>)Model.HtmlAttributes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a "behavior" attached to this HtmlAttributes property that will initialize the dictionary automatically to prevent such tests. Can you try?

};
var htmlAttributes = (Dictionary<string, object>)Model.HtmlAttributes;

if (htmlAttributes == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to set the attributes even if Model.HtmlAttributes is null, meaning don't check for it, just assign it and see if that works (some magic we made in Orchard1).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, it doesn't work.
Anyway I found a bug introduced in the last commit and I fixed it and tested everything from scratch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's because the existing property on the shapes is named Attributes. Can you try to use this one and even doing something like Model.Attributes["required"] = "required" for instance?
And it also already has a IList<string> Classes property which isn't null.


public class TitlePartSettings {
// Whenever this constant is changed a new migration step must be created to update the length of the field on the DB
public const int MAX_TITLE_LENGTH = 1024;
Copy link
Member

@sebastienros sebastienros Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pascal case

Suggested change
public const int MAX_TITLE_LENGTH = 1024;
public const int MaxTitleLength = 1024;

@sebastienros
Copy link
Member

@AndreaPiovanelliLaser let me know if you think we should review it again?

@MatteoPiovanelli-Laser
Copy link
Contributor

He only changed the the casing to PascalCase per your September recommendation.
We've been testing this for a while on our test and staging environments, so if it's still fine for you, we are ok with it.

@AndreaPiovanelli
Copy link
Contributor

@AndreaPiovanelliLaser let me know if you think we should review it again?

As Matteo said, I only changed the casing of the MaxTitleLength const, so I think this pr is safe to be merged.

@MatteoPiovanelli-Laser MatteoPiovanelli-Laser merged commit 44bfa39 into OrchardCMS:1.10.x Feb 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants