These are chat archives for OrchardCMS/Orchard

10th
Nov 2016
Jean Jordaan
@jean
Nov 10 2016 05:09

we're running into the max db size issue .. OrchardCMS/Orchard#4224 ... where do we hardcode the db size?

For the record, https://github.com/OrchardCMS/Orchard/blob/b931b79115c062ee0c9f008131510d4fb2f9faf8/src/Orchard/Data/Providers/SqlCeDataServicesProvider.cs#L39 is the line to be hacked for a quick & dirty fix.
Noted on https://github.com/OrchardCMS/Orchard/issues/4224#issuecomment-259602830

Robert
@remesq
Nov 10 2016 16:47
Is it possible to use a Token in a .cshtml file? I am using ShapeExecute to use .cshtml files, but I am wondering if within that .cshtml file I could pass something similar to what you do in an E-Mail Body workflow (i.e., FormSubmission.Field:Whatever).
Matteo Piovanelli
@MatteoPiovanelli-Laser
Nov 10 2016 19:53
@remesq I am not familiar with ShapeExecute. However, all the modules I worked with and that use .cshtml files have a way of passing them stuff (Usually the WorkContext, OrchardServices, a ContentItem).
I would reccomend, if you can, going through the source code and looking at wherever the razor engine is called for what's passed in the model.
Simon Poissant
@spoissant
Nov 10 2016 22:38
I guess I'm being lazy and I could test it myself but I'm asking just in case someone has the answer on top of their head. I can use the OrchardFeature attribute over a PartDriver to essentially "disable" my part when the Feature is not enabled but what about OrchardFields that are attaced to the Part? Will disabling my ContentPart Driver prevent the ContentFieldDrivers from being invoked? Or do you know of a good way to disable Fields based on a Feature being disabled?
S├ębastien Ros
@sebastienros
Nov 10 2016 22:40
use the attribute on the driver, it won't be rendered
the field won't be removed if it was used, the metadata will still be here
Simon Poissant
@spoissant
Nov 10 2016 22:44
On the Field driver you mean? Or the Part Driver of the Part the field is attached to?

The FieldDriver is not an option, that would disable all instance of a given Field Type which is unfortunately not viable in my case.

I might be overthinking this, I guess until my Feature has ben enabled and the Migration ran the Field will not exist but in my context there is a chance the Feature would be disabled and re-enabled over time

Simon Poissant
@spoissant
Nov 10 2016 22:50
Actually, I could potentially create my field inside IFeatureEventHandler.Enabled and remove it inside IFeatureEventHandler.Disabled instead of using Migrations. I feel that would be the best compromise right now
As you said @sebastienros the field data will remain in the infosetStorage even if the Field itself is removed so I'm all good for disabling/re-enabling multiple times
It doesn't apply in my case but if you know exactly what ContentType your Fields must be attached to you could create a placeholder Part, attach the Fields to it and weld the Part implicitely to ContentTypes inside ContentHandlers.
And use the OrchardFeature attribute on the ContentHandler.
Ok, thanks for the feedback @sebastienros, keep up the good work!