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
2
votes
0answers
34 views

Glass v5 caching and Sitecore security

As part of a Sitecore upgrade I'm also upgrading Glass Mapper to latest version (5.8.177). We were previously on version 4. Our site uses Sitecore OOTB Security and some users do not have read access ...
0
votes
1answer
41 views

Glassmapper5 returning null for derived type

I am working on Glassmapper 5 and I have baseType and derived type. I need to get derived type(IRich_Text_Section) property values by using basetype(I_PageSection). It is working fine in glassmapper4. ...
1
vote
2answers
56 views

Issue in applying lazyload for images in @Editable

A Glassmapper is used in our running project and planning to apply lazy loading for all images. For this, I have to implement the renderField Pipeline to apply lazyload functionality to all images. It ...
0
votes
0answers
23 views

Glass.Mapper.Sc, Version=4.4.0.199, Culture=neutral, PublicKeyToken=null is not marked as serializable [duplicate]

Issue :- When using redis cache with interface classes for glass mapper is throwing below issue Sitecore version : 9.0.2 glassmapper : Version=4.4.0.199 Type 'Glass.Mapper.Sc.LazyItemEnumerable`1[[XXX....
1
vote
1answer
46 views

Is there a way to use @Editable (Glass-mapper) and an anonymous model in an html input placeholder?

I have an input box and I would like to be able to have the placeholder text XP editor friendly. <input type="text" class="form-control" placeholder="@Editable(x => x....
1
vote
1answer
68 views

Is there a way to programmatically add attributes to the Glass Mapper Link class

In my code, if the Link field target Item matches the context item I want to add CSS class as active and also add the attribute aria-current=page. Is there a way to add custom attributes to the Glass ...
0
votes
0answers
28 views

Is there a way to map Sitecore/System/Languages in Sitecore to Sitecore.Globalization.Languages using Glass mapper

I am using TDS and was trying to map the Glass mapper to Sitecore.Globalization.Languages. This requirement is for a Language dropdown with custom names for different regions.
0
votes
1answer
46 views

Glass Mapper Upgrade to 5.8.177.0. GetDatasource is no longer working after GlassController Obsolete

The following code was working before the upgrade to the latest glass mapper. Since removing the GlassController inheritance the following no longer works. Is there something in the latest version ...
0
votes
1answer
121 views

Using GlassMapper Models in View Rendering

Sitecore 9.3 I have a view rendering where I was previously using the RenderingModel in the view, () but have switched to using the GlassMapper classes instead (). This works great unless the ...
0
votes
2answers
45 views

How to select an item property in a drop list using Sitecore 8.2 and Glassmapper

it's been a while since I've used Sitecore and I'm struggling with an issue. There is a model which is being autogenerated by TDS and uses Glassmapper for its mapping. [SitecoreType(TemplateId=...
1
vote
0answers
22 views

Rendering SVG as XML using Glass Mapper

I was curious if anyone has a good solution for rendering SVGs using Glass mapper so that the result is XML embedded into the HTML instead of an tag. I know that I can use Editable() with a ...
0
votes
1answer
56 views

Replacement for VersionCountDisabler() in Sitecore 9.3?

We are working on upgrading our solution from Sitecore 8.2 to 9.3 and we came across with the VersionCountdisabler() which is used for the purpose of fallback operation on 8.2 code. Below is the ...
0
votes
1answer
38 views

Glass mapper does not filter items that have "Hide versions" checked?

Is there a way to make Glass Mapper to filter out items which have "Hide versions" standard field checked?
0
votes
0answers
39 views

Rendering Parameters values being null after sitecore upgrade

We have upgrade Sitecore solution from 9.1 to 10.11, as part of upgradation we had upgraded Sitecore databases and solution. We have around 80 plus sites and we are using sxa. Let me describe about my ...
0
votes
0answers
48 views

Glass Mapper: Cast<MyClass>(myItem) returning null, while previously was correctly returning an instance of MyClass

I have the following legacy code wrote by my predecessors: var formSection = SitecoreContextFactory.Default.GetSitecoreContext().Cast<FormSection>(section); FormSection is a simple class with ...
0
votes
1answer
82 views

SitecoreService.GetItem not returning Children/Child Items

The below code is not returning the children's, var TemplateID = Guid.Parse("{51A26CD4-FCB5-4A3C-8720-2D60F625A678}"); var _Options = new GetItemByIdOptions(TemplateID) { ...
1
vote
1answer
38 views

Glass mapper A/B testing error - Model item passed as rendering instead of model

I am using Sitecore 9.3 with Glass.Mapper 5.6.163. When I setup simple A/B testing with different content datasource. I get the below error. Inner Exception: The model item passed into the dictionary ...
3
votes
1answer
86 views

Unit Testing with GlassMapper and GetItemByIdOptions

I have some code that retrieves a glass item like this: var root = this.RequestContext.SitecoreService.GetItem<ILookupFolderTemplate>( new GetItemByIdOptions(new Guid("{...
1
vote
1answer
135 views

Glass Mapper and inheritance problem

I am using solution with (the latest for today) Glass Mapper 5.8.173 along with Sitecore 10.0 update 1, where I have upgraded the whole large solution from old Sitecore 8.2 and Glass Mapper 4. I have ...
0
votes
1answer
49 views

Mock SiteSettingsProvider with Glass Mapper

Does anyone know how I can go about mocking the SiteSettingsProvider in Habitat? Item sitecoreItem= mvcContext.GetContextItem<Item>(); Item settingsItem= settingsProvider.GetSetting(...
1
vote
1answer
49 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
1answer
43 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-...
0
votes
1answer
351 views

Could not create instance of type: Glass.Mapper.Sc.Pipelines.GetChromeData.EditFrameBuilder

Sitecore 9.3 We upgraded from Sitecore 8.2.3 by installing vanilla 9.3 on a server and applying our update to it. When I try to view any page in experience editor I get the error Error Rendering View: ...
1
vote
1answer
156 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 ...
1
vote
0answers
25 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 ...
3
votes
2answers
320 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 : ...
1
vote
2answers
526 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(...
2
votes
2answers
123 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
604 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> (...
1
vote
1answer
75 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 ...
1
vote
2answers
115 views

How to pass language to Glass BeginRenderLink

I have a Link field in Sitecore where user could choose any link, site has multiple languages and cultures. In case if user sets a page in the link field that does not have language in current context,...
1
vote
1answer
580 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
141 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
865 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
1k 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
1
vote
1answer
597 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
77 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
438 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; }...
4
votes
0answers
154 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
296 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
138 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....
1
vote
0answers
253 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
326 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
360 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
201 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
443 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
81 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
30 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
627 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
1k 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
2 3 4 5