Questions tagged [glass-mapper]

Questions relating to the Glass.Mapper.Sc ORM framework. More information about the framework is available here: http://www.glass.lu/

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

GlassMapper 5.6.160: Component addedon SharedLayout without a version is displayed

Following the below steps, we see an issue in Sitecore v9.3.0 + Glass V5.6.160, compared to Sitecore v9.0.1 + Glass v4.5.0.4: Create a datasource item, version ONLY in EN culture. the fields has ...
0
votes
0answers
15 views

Glass Fluent mapping - map linked item's field a property

I have ItemA that has a single ItemB linked to it via droplink field. How do I map a single field from ItemB to a field in ItemA using Fluent mapping? i.e: class ItemA { string Title {get; set;} ...
0
votes
0answers
57 views

Glass Mapper: MvcContext is null

I have added Glass Mapper v5 to an exiting solution and now I'm facing this error when trying to create a controller. public SampleController : Controller { private readonly IMvcContext _mvcContext;...
0
votes
1answer
26 views

GlassMapper Returning Null for Item Template Information

After upgrading to Sitecore 9.3 and GlassMapper 5+ the TemplateId and TemplateName are coming back as nulls. The item is retrieved using MvcCurrentContext.GetContextItem. TemplateId: {00000000-0000-...
1
vote
1answer
63 views

Method 'Finalise' in type 'Glass.Mapper.Sc.IoC.DependencyResolver' … does not have an implementation

We were on 8.2.3 and I am trying to get our instance up to 9.3. I started with a vanilla 9.3 initial install and installed an update to apply our custom renderings, templates, etc. At the end of the ...
0
votes
0answers
18 views

Replacement for GetItemWithInterfaces in GlassMapper latest

We are currently on GlassMapper 4.5 and looking to upgrade to the latest version of GlassMapper. We have a couple of spots where we are using GetItemWithInterfaces. This method no longer exists and I ...
2
votes
2answers
88 views

Not able to edit fields in experience editor after upgrading to Sitecore 9.2 with glass 5.6

Working on an upgrade from Sitecore 8.2 to 9.2, I also upgraded glassmapper 4.3 to 5.6 In glass 5 also some changes in the controllers: Glass 4: public class MainVisualController : ...
0
votes
1answer
146 views

Extra P tag is added in Single-Line-Text while updating from Experience Editor in Sitecore 9.3

I am using Siteore 9.3 also using Glass mapper 5 and I have one Single-Line-Text and I am binding value just like mentioned below: <div class="heading-5 header-text">@Html.Glass().Editable(...
0
votes
1answer
140 views

Sitecore Glass mapper SitecoreContext returing null

I am using Sitecore version 8.2 update 2 Glass.Mapper.Sc.Min82 (version 4.5.0.4) I see the Null Reference Error in this line inside the controller. var context = new SitecoreContext(); //Throwing ...
1
vote
2answers
61 views

How to map tracking field with glass mapper

Using native Sitecore ways, the following can be achieved by doing: var pageItem = Sitecore.Context.Item; var trackingField = new TrackingField(pageItem.Fields["__Tracking"]); The question is ...
2
votes
1answer
202 views

Glassmapper 5 GetItem in language version

I need to extract an item with Glassmapper in specific language. But in Glassmapper 5 this method is marked as "Obsolete": _sitecoreService.GetItem<IAvailableCountries> (...
0
votes
0answers
63 views

[MissingMethodException: Constructor on type 'xxx.PublicSite.Models.ContentModels.Menu.IHeaderMenuNavigation' not found.]

[MissingMethodException: Constructor on type 'xxx.Website.Models.ContentModels.Menu.IHeaderMenuNavigation' not found.] System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, ...
1
vote
0answers
43 views

Sitecore Glass Mapper 5.5.28.0 BaseChildren.OfType not working

We have upgraded our sitecore website to Sitecore 9.2 and also updated our Glass Mapper to version 5.5.28. Currently, we noticed that we can't get the children on our iteration when we specify the ...
0
votes
1answer
48 views

How to pass language to Glass BeginRenderLink

I have Link field in Sitecore, user could choose any link at this field, site has mutli language and culture. In case of user set a page at link field that does not have language in current context, ...
1
vote
1answer
313 views

Glass Mapper v5 not mapping Glass.Mapper.Sc.Fields.Link fields correctly

We are upgrading Sitecore to 9.3 and glass mapper to Glass.Mapper.Sc.93 (v5.6.158-alpha). Having an issue with most of our Glass.Mapper.Sc.Fields.Link types coming back as null. which used to work ...
1
vote
1answer
89 views

Not able to get count from Search response using Glass Mapper

Environment details: Sitecore 9.0.2 with Solr and GlassMapper I am using the method: public IEnumerable<TModel> GetAll<TModel>(string query, string language) where TModel : class ...
4
votes
1answer
465 views

Getting full image URL using Glass Mapper without RenderImage

Html.Glass().RenderImage(Model, x => x.Logo, new { mw = 200 }, Editable:true) The code above outputs an img tag with the full URL including the hashed parameters. I want a way to get just the ...
2
votes
1answer
643 views

Experience Editor issue after upgrading to Sitecore 9.3

After upgrading to Sitecore 9.3 getting below error in Experience Editor:- sitecore Method not found: 'Void Sitecore.Pipelines.GetChromeData.GetChromeDataProcessor We are using Glass Mapper
0
votes
1answer
302 views

Glass mapper returning null for shared fields with values

I have an SXA site. It has language fallback enabled on the site node. Page and component datasource templates' standard values have had both their item level and field level fallback enabled for non-...
1
vote
1answer
51 views

String not geting rendered in Experience Editor

Environment: Sitecore 9.0.2 + Glass mapper I have a model class like this: public class SingleStack { public Glass.Mapper.Sc.Fields.Image Logo { get; set; } public string ...
2
votes
1answer
252 views

Glassmapper | Cannot save a class that does not contain a property that represents the item ID

Environment: Sitecore 9.0.2 + Glass Mapper I have a class like this: public class Sample { public Glass.Mapper.Sc.Fields.Image Logo { get; set; } public string Destination_Name { get; set; }...
3
votes
0answers
122 views

SitecoreRequestScopeModule holding many objects leading to memory leak

We are seeing a steady memory growth on our Sitecore 8.2 update 1 application. We had AUTOFAC DI previously and have been completely replaced with Sitecore OOB MS DI. We followed some guidance from ...
4
votes
2answers
188 views

Rendering images through TreelistEx

Environment: Sitecore 9.0.2 + Glassmapper I am trying to create a component like this. So in the template, for the images (stored in Sitecore Media Library), I have taken a field of type TreeListEx. ...
1
vote
1answer
52 views

Glass GetItems not returning sorted items

I am not able to get glass to return items sorted correctly. I have this code. var options = new GetItemsByQueryOptions(new Query($"<mypath>/*")); var myitems= this.contentRepository....
0
votes
0answers
191 views

MVC Layout model is empty after Glass Mapper Upgrade

We recently upgraded from Sitecore 8.2.0 to Sitecore 9.2.0. Along with other packages, we also upgraded to the latest compatible version of Glass Mapper 5 for Sitecore 9.2.0. We use Simple Injector ...
1
vote
1answer
242 views

High CPU and Memory with 2 million glass disposables

We have been seeing the high CPU and constant growth of memory. When analyzing the memory dump I noticed that the memory is occupied by 2 million Glass Mapper objects. Has anyone faced this issue and ...
2
votes
1answer
219 views

Mapping Class with multiple Sitecore templates in [SitecoreType()] Attribute

I have to map a class with more than one template in GlassMapper. My code is like below. [SitecoreType(TemplateId = "{6173F07E-BC5B-4409-A75A-DF1B0D117C41}", AutoMap = true, EnforceTemplateGlass....
0
votes
1answer
171 views

Using Glass to add content with fluent config - map to interface and concrete class

My typical build-out for Glass and fluent config is to use an interface and map file (using SitecoreGlassMap) for modeling, but I know if I need to use the model to add data to Sitecore I can't use ...
-1
votes
1answer
271 views

Glass Mapper is not returning an Image Field

I have a model that looks like this: [Serializable] [SitecoreType(TemplateId = "{guid}", AutoMap =true)] public class EventInfo : GlassBase { public virtual string PageTitle { get; set; } ...
0
votes
0answers
64 views

SitecoreQuery issue in glass mapper

I use glass mapper 5.3 and I use SitecoreQuery in this field: [SitecoreQuery("/sitecore/content/Newsroom/Data/Enumerations/Companies/*")] public virtual IEnumerable<EnumerationValueItem> ...
0
votes
1answer
27 views

Map user profile fields via Glass

I've created a custom user profile and attached it to a user type. When I do a GetUser and tell it I want the profile properties, is there a mechanism to map this data to a Glass model, or is this ...
1
vote
1answer
326 views

Glassmapper 5 SitecoreChildren listing items even if the version count is 0

We upgraded Glass Mapper version from 4.2.1.190 to 5.4.21.0. In our model, we are using [SitecoreChildren(InferType = true)] to get the child items. For few of the child items, language fallback is ...
4
votes
1answer
977 views

How do I map a list of Templates with Glass Mapper?

I've got a TreeList field on one of my templates that allows me to select multiple templates. I'm having trouble mapping this to my model with Glass Mapper. [SitecoreType(TemplateId = "{Template-Id-...
1
vote
2answers
375 views

Glassmapper 5.1 Error when Datasource has no version

We recently upgraded our Sitecore to 9.1 and also Glassmapper5.4.21 along with it. What we noticed is that some of the view renderings have a data source that does not have a version in a particular ...
1
vote
1answer
151 views

Editable in a foreach loop?

I know I've done this before but I just don't remember the proper syntax. I have a page where the model is EventItem, and EventItem has a list of EventSpeakers and each speaker has an image field. I ...
0
votes
1answer
363 views

The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel'

We recently upgraded to 9.1 and updated our glassmapper to 5.4.1. After doing the upgrade and running our application I am getting this error. We dont have any model definition in siteocre and this is ...
1
vote
1answer
62 views

Can I use Content Search with Glass to query children of a specific template?

My Sitecore Item has children of different Templates. To query them, I use the following field declaration: [SitecoreQuery("*[@@templateid = '{ID of my Template}']", InferType = true, IsRelative = ...
1
vote
1answer
388 views

Glass Mapper - Item not null when language version not present

I'm using Glass 5.4.18 with Sitecore 9.0.2. I have a base template for my site that has language fallback turned on by default, but for a few items the client wants to disable language fallback so the ...
3
votes
1answer
346 views

Sitecore GlassMapper and Json.NET

I need to pass parameters in Json format from Sitecore item. I am getting Sitecore item using GlassMapper. public interface ISomeType { //some fields } public interface ISomeFolder { ...
1
vote
2answers
204 views

Map text field to nested object

I have a model which has two nested classes within. I am unable to find any resources how to map this correctly. In Sitecore the Address.cs corresponds to the template Address which has a droplink to ...
2
votes
1answer
59 views

Dealing with different types of SitecoreParent

Templates A and B both inherit from Templates C. I have an item that can have either an A or a B as parent. How can I use the [SitecoreParent] attribute in order to retrieve either according to the ...
1
vote
1answer
255 views

How do I programmaticaly set an image on glassmapped item

So I have a glassMapped item with an image. [SitecoreType(TemplateId = TemplateIdConstants.NationalChain, EnforceTemplate = SitecoreEnforceTemplate.Template)] public interface IChain : IGlassBase { ...
0
votes
0answers
105 views

How to upgrade Glass Mapper code that uses AbstractGlassUserControl?

I am upgrading some Glass Mapper code that I inherited. The previous version of Glass Mapper was v3 and I am upgrading to v5.3.17. I have a class that looks like this: public class MyRepository : ...
-1
votes
2answers
316 views

Space with 'Name Value List' in Sitecore

We are using Glass Mapper to map the values from Sitecore. System.Collection.Specialized.NameValueCollection is used in Glass Mapper class to map Name Value List from Sitecore. This example data is ...
0
votes
1answer
96 views

Experience Analytics page conflict with Glass Mapper

I'm getting the following error message when I go to Experience Analytics from the dashboard in 9.0.2 (rev. 180604). We are using Glass Mapper elsewhere in the application, but there's no ...
2
votes
1answer
692 views

Sitecore Glass Mapper 5.3.15 not loading children by default

I have upgraded the website to Sitecore 9.0.2 and since my project has a dependency on Glass mapper, I have upgraded Glass mapper to 5.3.15. My Glass mapper maps to the menu model and it does load ...
0
votes
0answers
87 views

Some fields are not being saved in experience editor

I have a component that has following fields: Title Image Link Title Link Among these fields, Title and Link Title are not being saved while editing in the Experience Editor, upon ...
1
vote
0answers
108 views

Glass GetRenderingParameters SQL query

We are using the method GetRenderingParameters<T>() from Glass in many different places in our code. This method works correctly, it returns the rendering parameters as a strongly typed object. ...
1
vote
1answer
171 views

Droplink value is always returning null in post action

I am trying to build a form which contains state as droplink and given datasource as states . here's the snippets of my employee model and state. i am getting all the states in the get action of ...
1
vote
0answers
360 views

Problem upgrading Glass Mapper from v4 to v5.3.15

I’m trying to upgrade our solution from Sitecore 9.0.2 to Sitecore 9.1 and I’ve also updated Glass Mapper from version 4 to version 5.3.15. In my Service registration I’ve added the following three ...

1
2 3 4 5