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
24 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
69 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
40 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
80 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
26 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
35 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
40 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
150 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
62 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
255 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
404 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
48 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
164 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
41 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
171 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
102 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
145 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
37 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
150 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
117 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
204 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
158 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
157 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
184 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
59 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
0answers
40 views

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

I've inherited a Sitecore upgrade from 8.0 to 8.2u7 half way through and I've found this issue which only sporadically happens. The model item passed into the dictionary is of type 'Sitecore.Mvc....
0
votes
0answers
134 views

Glass mapper return different type - GlassBaseProxy

We use Glass mapper 5.3 TDS generate this code public partial class AggregatorComponentItem : GlassBase, IAggregatorComponentItem public partial class GNR_Press_ReleaseItem : GlassBase, ...
0
votes
1answer
24 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 ...
0
votes
0answers
24 views

Template id not getting set using glassmapper _sitecoreContext.GetCurrentItem

I have an item item1 in sitecore with redering rendering1 in its presentation details. The rendering rendering1 has its datasource and is a controller rendering. The datasource of the rendering one ...
1
vote
1answer
225 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 ...
0
votes
0answers
44 views

Cannot resolve parameter 'Glass.Mapper.Sc.ISitecoreContext context'

I am getting below exception while doing a service call in Sitecore 9.1, Cannot resolve parameter 'Glass.Mapper.Sc.ISitecoreContext context' of constructor 'Void .ctor(Glass.Mapper.Sc....
4
votes
1answer
689 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
256 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
118 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
285 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 ...
1
vote
1answer
56 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
298 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
260 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
155 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
197 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
86 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
250 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
85 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
531 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
77 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
101 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
152 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
298 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
59 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 ...

1
2 3 4 5