Giter VIP home page Giter VIP logo

navigation's People

Contributors

adamkarnowka avatar diwipl avatar drabikowy avatar evilprophet avatar kpawlus avatar leone avatar pinkeen avatar ptylek avatar tymzap avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

navigation's Issues

Adding template generation timestamp to cache key, so the `/navigation/mobile/index/` can be cached on client

Currently on each store visit GET /navigation/mobile/index/?cache_key=... request is done from the client which returns HTTP 200.

Since it already includes cache key, why don't we make it return 304, so it can be cached forever on the client, to make its' response even faster?

However, we would need to add "template generation timestamp" to the MageSuite\Navigation\Block\Navigation.getCacheKeyInfo(), which could be cached between requests in in-memory cache (redis), so that the cache key is changed when bin/magento cache:clean is done (e.g. after categories tree is changed).

WDYT? Would u accept PR for that?

Returned Categories Array treated as Object

We have the following Issue after (index:reindex):

Fatal error: Uncaught Error: Call to a member function clear() on array in /var/www/vendor/creativestyle/magesuite-navigation/Service/Navigation/Builder.php:82 Stack trace: #0 /var/www/vendor/creativestyle/magesuite-navigation/Service/Navigation/Builder.php(36): MageSuite\Navigation\Service\Navigation\Builder->getChildrenCategories(Object(Magento\Catalog\Model\Category\Interceptor)) #1 /var/www/vendor/magento/framework/Interception/Interceptor.php(58): MageSuite\Navigation\Service\Navigation\Builder->build('2', 'desktop') #2 /var/www/vendor/magento/framework/Interception/Interceptor.php(138): MageSuite\Navigation\Service\Navigation\Builder\Interceptor->___callParent('build', Array) #3 /var/www/vendor/magento/framework/Interception/Interceptor.php(153): MageSuite\Navigation\Service\Navigation\Builder\Interceptor->Magento\Framework\Interception\{closure}('2', 'desktop') #4 /var/www/generated/code/MageSuite/Navigation/Service/Navigation/Builder/Interceptor.php(26): MageSuite\Navigation\Service\Navigation\Builder\Interceptor- in /var/www/vendor/creativestyle/magesuite-navigation/Service/Navigation/Builder.php on line 82

It seams to be related to this Code:

$categories = $category->getChildrenCategories();

The returned Categories are treated as an Object (Collection) when in fact it's an array. I can not say why that happens, but it seams to be correct according to the DocBlock auf the called function:
vendor/magento/module-catalog/Model/Category.php:984

/**
     * Return children categories of current category
     *
     * @return \Magento\Catalog\Model\ResourceModel\Category\Collection|\Magento\Catalog\Model\Category[]
     */
    public function getChildrenCategories()

Magento_Catalog Version: 103.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.