Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 20:18
    kcastro18 closed #8158
  • Jan 31 20:18
    kcastro18 commented #8158
  • Jan 31 20:17

    sebastienros on 1.10.x

    Delete obsolete profile images … (compare)

  • Jan 31 20:17
    sebastienros closed #8157
  • Jan 31 20:13
    sebastienros commented #8158
  • Jan 31 20:03
    Skrypt commented #8158
  • Jan 31 19:47
    kcastro18 commented #8158
  • Jan 31 19:45
    kcastro18 commented #8158
  • Jan 31 19:39
    Skrypt commented #8158
  • Jan 31 19:38
    Skrypt commented #8158
  • Jan 31 19:35
    Skrypt commented #8158
  • Jan 31 15:08
    kcastro18 opened #8158
  • Jan 31 03:39
    yuliang2417535997 starred OrchardCMS/Orchard
  • Jan 31 03:39
    yuliang2417535997 starred OrchardCMS/Orchard
  • Jan 29 21:28
    yanxiaodi starred OrchardCMS/Orchard
  • Jan 29 02:40
  • Jan 28 16:24
    LorenzoFrediani-Laser opened #8157
  • Jan 28 16:02
    LorenzoFrediani-Laser opened #8156
  • Jan 28 15:51
    LorenzoFrediani-Laser starred OrchardCMS/Orchard
Jean Jordaan
@jean
counter was nice, very easy to see things matching up correctly
for when you're generating content from CSV, for example :grin:
Xceno
@Xceno
True! :D
Debugging guids ain't very nice, I just like that everything has the same type of Identifier when I export things again
Matteo Piovanelli
@MatteoPiovanelli-Laser

@Xceno I am going to keep passing the provider as a parameter to the views for now, because it's easier. Honestly, I am not a fan of having to resolve the provider several times per page, as may be required by the solution we discussed (@Display.PriceString(Price: Model.Price))

I could have the provider implement IFormatProvider, then I would just do:

string.Format(provider, {0}, Model:Price)
but that's something for later. Now I have something that works, even though I find it ugly
Xceno
@Xceno
Yeah I see your point. Resolving it several times isn't a very nice approach.
Besides that, is there a reason to format the price inside the view, instead of creating a viewmodel with a string FormattedPrice property?
But I like your idea of implementing IFormatProvider
Matteo Piovanelli
@MatteoPiovanelli-Laser
Honestly, the main reason why I want to format things in the views is that I am lazy and don't want to change all the models/viewmodels that have price-as-number in them, and I don't want to look at all the other possible changes that would entail. I may also want to be able to do some operation in the views (comparisons at least), so I would still have to also have the numeric values.
Matteo Piovanelli
@MatteoPiovanelli-Laser
I was also planning to get the cultures (for the currencies) from the .Net framework, but that does not seem to give me an elegant way to filter stuff, so I would get for example seemingly different currencies for each region in the Euro zone
I fell back, for now, to using an hardcoded ISO4217 table
Xceno
@Xceno
@MatteoPiovanelli-Laser check out https://github.com/remyvd/NodaMoney for handling currencies. Maybe it's of use to you.
I had no project require it for some time now, but I remember it was a tremendous help back then
Matteo Piovanelli
@MatteoPiovanelli-Laser
@Xceno that looks great. I'll definitely give it a look. As you might have guessed, I am expanding/fixing/enhancing Nwazet, so I'll have to see what @bleroy thinks about that as well.
Xceno
@Xceno
Does someone know if I can Monitor multiple CacheSignals, so that the first Token to expire invalidates the cache?
Sébastien Ros
@sebastienros
yes you can
ctx.Monitor(s1); ctx.Monitor(s2);
Xceno
@Xceno
awesome thx!
Sébastien Ros
@sebastienros
a cache entry can monitor as many tokens as you want
and the same principle applies to ASP.NET Core IMemoryCache
Jean Jordaan
@jean
I think Orchard is angry at me.
This tenant is currently initializing. Please try again later.
(We're evidently doing something bad on startup .. fixing ..)
pritchardhobe
@pritchardhobe
Hey all. I've run into an issue when moving into our production environment, that does NOT happen in QA. Getting an error almost immediately (in some cases) or on save (in others) when working with elements/widgets on content pages.
'code' An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.Layouts.Controllers.ElementController.Edit(String session) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>cDisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>cDisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>cDisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>cDisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>cDisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b3f() 'code'
looks like a session timeout. We use azure sql for all of our site management, and redis for cache.
since i don't have a web.config for the sites that contain the sessionState parameter, is this something i need to do at a server level? Aka on the azure sql or redis cache servers?
Sébastien Ros
@sebastienros
sessions should still work
do you have Instance Affinity turned on, it's on by default but you might have disabled it
also does it happen when after some long inactivity, I have seen this bug in this case
if this is it I think the bug has been fixed with a setTimeout that would keep the session active on the Layout editor page
pritchardhobe
@pritchardhobe
no, its an active page i'm working on and i can repeat it almost indefinitely. I haven't messed w/instance affinity. Where would that be located?
would that be ARR Afinity?
Sébastien Ros
@sebastienros
yes
pritchardhobe
@pritchardhobe
yep. its off.
i'll talk to my it team.. see if they can flip that back on. Its on in QA which is likely the root cause for it not working. thanks @sebastienros !
pritchardhobe
@pritchardhobe
and that did the trick. Such a little thing to cause a big rokus! Thanks @sebastienros again for the quick help on that.
Sébastien Ros
@sebastienros
good, it shouldn't have been changed in the first place
HarryHughes
@HarryHughes
Hey guys, if I want to implement a custom field type for editing content items or layout elements, what do I need to do to ensure the value selected is being saved back to the item (model)
I had thought Orchard just looked for fields with the id/name matching a specific property of a model and mapped the appropriate value.. as most elements just use for example Html.TextBoxFor which is just returning a html text field
This is what I currently have in my custom field-type.. Model.ID is the property name that I want to write to, and Model.Value is the existing value of that property. Maybe I misunderstand and there's something I'm missing to get this working though, lol.
<div class="editor-label">
<label for="@Model.ID">@Model.ID</label>

</div>
<div class="editor-field">
<input type="text" id="@Model.ID" name="@Model.ID" value="@Model.Value" disabled /> <a class="OpenModal" href="#" modalID="PointSelector">Select point</a>
</div>
Matteo Piovanelli
@MatteoPiovanelli-Laser

@HarryHughes this is assuming your driver is doing updates correctly:
Your snippet would maybe work if the value of Model.IDwas a string containing the identifier of Model.Value.

Suppose in your driver you have:

protected override string Prefix {
    get { return "YourPrefix"; }
}
protected override DriverResult Editor(YourPart part, IUpdateModel updater, dynamic shapeHelper) {
    var model = new YourPart();
    updater.TryUpdateModel(model, Prefix, null, null);
    [...]
}

What I think would work in the view is something like:

<input type="text" id="YourPrefix_YourPart_Value" name="YourPrefix.YourPart.Value" value="@Model.Value" disabled />

Using the helpers does that thing for your, allowing a mapping in the drivers. In you case, something like:

@Html.TextBoxFor(m => m.Value, new { @disabled = "disabled" })
Jean Jordaan
@jean
is there a way to say that a Containable item may only be created in the Container items that allow it?
I.e. it shouldn't be possible to create it outside of a container.
Jean Jordaan
@jean
Does Orchard have the concept of content items that can be put in some order via drag'n'drop ?
Xceno
@Xceno
you can order it inside containers
via drag n drop
Jean Jordaan
@jean
ah yes, I saw that. So if I want something orderable, I need to put it in a container
Xceno
@Xceno
exactly
i think you can also order it via contentPickerFields but i'm not sure right now
Jean Jordaan
@jean
hmm now I made Event a container which contains EventMap items, I can select Member of Event on map items, but after save that field is back to None
ah! Event wasn't Published. :ok_hand:
Jean Jordaan
@jean
@Xceno on EventMap items I have a Position text input, but I don't see where to drag'n'drop. On an Event item, I have checked Show contained items list and Enable positoning. I see the list, but can't drag'n'drop.
I also checked Enable drag and drop on the Event type definition, this made the Enable positoning option on the item vanish, still can't drag'n'drop.