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
1
vote
1answer
42 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
16 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
38 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
95 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
104 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
49 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
116 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
42 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
40 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
44 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, ...
0
votes
1answer
218 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
74 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
351 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
519 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
0answers
72 views

Glass mapper a/b testing null datasource

I have a problem with Sitecore and Glass Mapper, we are using Glass Mapper in our project and all works fine, but I've seen that trying to set an a/b testing I got an exception about null datasource. ...
0
votes
1answer
230 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
48 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
209 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
115 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
173 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
42 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
169 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 ...
0
votes
0answers
138 views

Error when trying to serialize a Glass Mapper object

I am doing a Sitecore / Glass Mapper upgrade from 7.2 -> 9.1.1. In 7.2 this code worked but now it is throwing an error. We are simply trying to serialize a custom class. The line of code looks ...
1
vote
1answer
232 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
202 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
161 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
230 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
62 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
25 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
255 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
828 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
313 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
134 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
321 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
58 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
340 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 ...
2
votes
1answer
302 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
177 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
55 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
229 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
95 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
282 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
88 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
596 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
81 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
106 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
159 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
328 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
vote
1answer
78 views

Equals sign (=) added after valueless query string parameters

When rendering an external link from a General Link field using the Glass Mapper BeginRenderLink helper, any query string parameters without values are getting an equals sign (=) added after them. An ...
2
votes
1answer
2k views

How to get children of an item via glass mapper?

I am building a navigation component using glass mapper. The problem I am facing is not being able to get children items of a navigation item. Right now I am only getting Parent navigation items. ...

1
2 3 4 5