/
Catalog active tab not saved [5.2.1-RC1]

Catalog active tab not saved [5.2.1-RC1]

One of the main ways to enter website information is called Catalog (see image below):

 

Data about different items in catalog is grouped by tabs:

  • Sections
  • Links
  • Articles
  • Topics
  • Products
  • etc.

To start working with a specific data type you need to switch to a dedicated tab, e.g. "Products" and then proceed with data adding/editing.

I've recently noticed a bug, that Catalog tab isn't saved after you add/edit an item on that tab and user is returned back to "Sections" tab all that time, which is pretty annoying.

After a bit of debugging problem ended up with a specific cookies present on the page:

  1. is_catalog_active_prefix - active tab in "Catalog Item Selector"
  2. catalog_active_prefix - active tab in "Catalog"

Due used approach in cookie value reading from document.cookie property is happens, that value of "is_catalog_active_prefix" is read instead of "catalog_active_prefix" cookie value because:

  1. they names partially overlap
  2. cookie with longer name was written first

I suggest, that we change way of retrieving cookie value in JavaScript to one of proposed in http://stackoverflow.com/questions/4003823/javascript-getcookie-functions article.

Related Tasks