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/
21
questions
11
votes
3
answers
3k
views
Attempt by method 'Glass.Mapper.Sc.Utilities.get_IsPageEditor()' to access method 'Sitecore.Context+PageMode.get_IsPageEditor()' failed
Just updated a simple instance of Sitecore 8.1 to 8.2, the actual solution contains a simple demo, some templates, items, nothing too complex. All went fine as I followed all the steps from the ...
14
votes
1
answer
5k
views
What are the options for Glass Mapper model attributes?
I have looked through the documentation and tutorials on the Glass Mapper site, but I can't find a list of the different attributes that are available and what they do.
3
votes
1
answer
951
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; }...
0
votes
1
answer
636
views
Glass Mapper 5 lazy loading
We migrated to Sitecore 10.1 and Glass Mapper is upgraded to 5.8.177.0 from 4.3.4.197.
I noticed the mapping was not working.
I changed the code from
var centreHours = glassContext.GetItem<...
15
votes
1
answer
7k
views
Editable Sitecore fields with Glass
Folks
I'm trying to do something basic here which is have a general link and an image field as editable in experience editor on my view using Glass.
my end goal is to have two editable fields which ...
7
votes
1
answer
983
views
Item not found when saving page in Experience Editor
I have a strange situation where I get a 'Item not found' on postback in Experience Editor when I edit an page.
The culprit is a controller rendering which has a line of code in to get the current ...
7
votes
2
answers
2k
views
Using Unicorn to Generate Glass Mapper Models
How can I use Unicorn to generate Glass Mapper models for my Sitecore items?
6
votes
1
answer
3k
views
After upgrading to Glass Mapper 5, unable to globally enable lazy loading
In the implementation using Glass Mapper 4.3.x, I was enabling Lazy Loading in GlassMapperScCustom:
public static IDependencyResolver CreateResolver(){
var config = new Glass.Mapper.Sc....
6
votes
2
answers
576
views
Glass Cast issues after upgrading from Sitecore 7.2 to 8.2
So, I upgraded a Sitecore solution from 7.2 to 8.2. All works well, except for the site. I keep on getting the error in my views like the one below:
The model item passed into the dictionary is of ...
4
votes
1
answer
592
views
Disabling the Glass lambda cache
I believe an issue we're running into might be related to the lambda cache in Glass - I'm also concerned about the performance ramifications if we were to disable it. Has anyone done this and ...
4
votes
2
answers
3k
views
How to use Glass Mapper's BeginEditFrame(string buttons, string dataSource, string title)
I've created my own custom experience button to edit some responsive images for a logo in my header and I added the button to the rendering. It works as expected and I am not having any problems with ...
4
votes
0
answers
216
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 ...
2
votes
1
answer
731
views
Sitecore 8.1 to 8.2 Glass Mapper Related Error?
I am attempting an update from Sitecore 8.1 Update 1 to 8.2 Update 2 and after running the update package and and showing now errors on the update, I am getting the below error after logging in.
I ...
2
votes
2
answers
687
views
Trouble creating content item using Glass Mapper on a CD server
I have a Sitecore 8.1 CD server. I have a page where a user can create a new shipping address and save it back to the Master database. I am using Glass Mapper for this. Here is my code:
Models....
2
votes
1
answer
5k
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.
...
2
votes
1
answer
852
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
1
answer
330
views
Too much item reads in Debug Mode
I am facing the following issue that I have a simple Controller Rendering with which is using the Demo template with 1 field (Label) and if I switch to Debug Mode in Experience Editor then I can see ...
1
vote
1
answer
970
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 ...
1
vote
1
answer
772
views
Glass Error opening Experience Editor (ObjectToSwitchTo)
I'm using @Html.Glass().Editable(Model, x => x.MyProperty) for some of our single-text / rich text fields. When I load the site with this code in the view everything looks fine. However, when I ...
0
votes
1
answer
1k
views
Glass mapper BeginRenderLink stripping query string parameter that is a Url with ga parameters
I'm using glass mapper BeginRenderLink to output some links:
@using (BeginRenderLink(link, n => n.Destination, isEditable: true))
{
@RenderImage(link, lnk => lnk.LinkIcon, isEditable: true, ...
0
votes
1
answer
628
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 ...