Accessable article data seems to be incoherent?

Hi there,

after playing around with the PE and revamping basically every templates it seemed weird to me that objects storing article data hold different sets of data, depending on the point of entry for an article display. This is the case if I put articles on the ‘homepage’ [start.tpl], the search [search.tpl] where f.e. I cannot access the articles root category id, this can also be the case if I drop into a subcategory via the category navigation.

Does anybody have an explanation for this behavior? I cannot browse the core code right now as it is zend encrypted, so maybe some of the developers or even users who frequent this board know an answer.

Regards

Hello,

to be honest: I did not get the point at all.

If you want to check the behaviour that seems to be wrong to you either have the possibility to check it in demoshop, load the vmware or check the source code of the CE.


Marco Steinhäuser
Community Guide
OXID eSales AG
http://twitter.com/marcosteinhaeus

“I cannot access the articles root category id” depending on the view an article is diaplyed on. Sums it up pretty good, doesn’t it?

Hi lyric,

That’s an interesting question. As you noticed only a part of article attributes is loaded due to functionality we call “lazy loading” mechanism. It’s a result of our attempt to save every possible consumed memory byte or executed millisecond. Generally speaking lazy loading takes care about loading only fields which are actually used in each view. So you will not get long description value in list page, because you do not need it.

And the good thing is that this is fully internal functionality and you do not have to take care about it. As soon as you want, let’s say, to display any new article attribute in template, you can simply add it the way you add any attribute. Shop recognises it is requested and next time it loads the value together with other attribute set.

Btw this way we save about 9% of execution time and about 1 Mb of consumed memory.

Kind regards ;)Tomas

Hi Tomas,

thanks a lot for your anwser. I don’t want to be blunt or rude, but there was a way to deactivate “lazy loading” in the admin frontend, right? :slight_smile:

As of now theres not so much traffic on the shop I am working on, so the 9% and 1mb savings do not matter to us, yet.

For the future I’d like to know though, how I can simply add attributes to the objects. Seems like I have skipped this part in reading the documentation. I’d apprechiate it, if you could show me how to add attribs by example for the category-rootid — thats something that would really help!

Regards,

Lyric

Hi Tomas,

I cant edit the code php because we’re using the encrypted PE :-/

How do you mean the property will be available if I call it somewhere before I need to use it? Could you give me an example? Thanks!

Regards,

Lyric

Well, it’s not really possible to deactivate it directly. You could change protected $_blUseLazyLoading = true; property over the module (or for the experiment directly) in oxarticle.php file. However, probably, you do not need that at all. You are printing all object and looking what properties you could use, but it works opposite. First you need to use the property and only upon the request it is fully loaded. So just use (for example display the value of) any oxarticles table field in any view ant it should work :wink:

RegardsTomas

Ah, one thing you can do you can call oxArticle::disableLazyLoading() method, this way lazy loading will be inactivated, just it works for particular object not for all objects.

RegardsTomas

Hi Tomas,

oddly enough just echoing in any template doesnt see mto work, as echoing twice should result in the property fully loaded and being echoed on the second echo. Wow, a lot of echoing going on there :wink:

Anyways, I can’t seem to get that to work properly. I cant work the core code either, because we’re using the encrypted PE…

On another note — one thing thats also weird is that sometimes an object has the desired property (e.g. oxarticles__oxvarselect for the “name” of variants) but the value is not loaded. Maybe this is due to lazyloading as well? Example: getVariantsList() via list.tpl.

Regards

[QUOTE=tomas liubinas;6256]Well, it’s not really possible to deactivate it directly. You could change protected $_blUseLazyLoading = true; property over the module (or for the experiment directly) in oxarticle.php file. However, probably, you do not need that at all. You are printing all object and looking what properties you could use, but it works opposite. First you need to use the property and only upon the request it is fully loaded. So just use (for example display the value of) any oxarticles table field in any view ant it should work :wink:

RegardsTomas[/QUOTE]