Jump to content
thirty bees forum
  • 0

Error when creating new category


Question

Posted

When I go to add a new category I receive the following error:

Notice on line 638 in file /home/artworld/trial.artworldonline.co.uk/controllers/admin/AdminCategoriesController.php
[8] Undefined index: category

Notice on line 647 in file /home/artworld/trial.artworldonline.co.uk/controllers/admin/AdminCategoriesController.php
[8] Undefined index: medium
 

I have installed panda theme for thirty bees.

 

If I create, within preferences > images - category_default and medium_default then i don't get the error. 

 

This may be because I have copied my database over from prestashop website without panda theme.

 

Does anyone have any advice?

Thirtybees issue.png

17 answers to this question

Recommended Posts

  • 0
Posted

I also have Panda but mine don't have the panda_ in front , they are like your last 2 .. ..Suppose you could try that and see what happens . Just remember to clear your Cache

  • 0
Posted
1 hour ago, wakabayashi said:

Is there any real problem? Because this is just a Notice message and looks very harmless. You wouldn't see it, if you switch of debug mode.

 

Sorry, yes.  When debug mode is off and those extra categories aren't added i get the attached error.

Test category.png

  • 0
Posted

And when those 2 categories are created, when I try to add Category Cover Image to an existing category or create a new category, it displays the following error: 

 

Test category 2.png

  • 0
Posted (edited)

Same error here as the original post. Not sure if it is actually Panda related though...
Now that it's more that one person that is experiencing this problem, maybe it would get looked into or seen as a 'real issue'?

 

Edited by Theo
  • 0
Posted

Hi guys,

I am facing the same problem as described in the first post. Is there any progress on the solution?

The strange thing is that I have 2 domains with TB1.1.x installed, hosted on the same web server, same PHP version, similar modules installed, same theme version (2xpanda licenses), but on one domain the created categories are available after creation. On the other not, how is this possible....

Any troubleshooting tip is welcome.

PS: I already asked Jonny (Panda support), but he thinks that it is not a theme problem.

panda_tb.jpg

  • 0
Posted (edited)

Stupid question I know. Have you tried refreshing the page to see if it goes away.. I have issues sometimes when the page doesn't load correctly I get different errors come up sometimes

Edited by AndyC
  • 0
Posted

Have you any modules that add tabs to your products when creating new items

example I have a extra tab that has caused issues in the past

Capture.JPG.fbf95b0d845e8adb26937e1853b66cd1.JPG

only trying to help

  • 0
Posted

@AndyC I'm thankful for any hint/tip.

No, not really. I also uninstalled the "related product module", anyhow still same problem persists

panda_tb2.jpg

  • 0
Posted

The following are my next findings:

1. i checked the database and found out that the following tables are responsible for the categories:

  • tb_category
  • tb_category_group
  • tb_category_lang
  • tb_category_product
  • tb_category_shop

2. in the table tb_category_lang I have identified the strings for all categories. In it I can see the created test categories.

3. enable profiling for debug purposes and disable cache + CCC.

4. when trying to create a new category, profile interaction with category tables is detectable

5. when trying to create a new product, interaction with category tables is NOT available --> What? How does the form know which categories to display for selection?

  • 0
Posted

Profile for new category:

Stopwatch SQL - 69 queries
Query 	Time (ms) 	Rows 	Filesort 	Group By 	Location

SELECT SQL_NO_CACHE c.`name`, cl.`id_lang`, IFNULL(cl.`value`, c.`value`) AS `value`, c.`id_shop_group`, c.`id_shop`
FROM `tb_configuration` c
LEFT JOIN `tb_configuration_lang` `cl` ON c.`id_configuration` = cl.`id_configuration`

	8.5 	2114 			/classes/Configuration.php:437

SELECT SQL_NO_CACHE t.`class_name`, t.`module`
FROM `tb_tab` t
WHERE (t.`module` IS NOT NULL) AND (t.`module` != "")

	3.6 	106 			/classes/Tab.php:191

SELECT SQL_NO_CACHE m.`page`, ml.`url_rewrite`, ml.`id_lang`
FROM `tb_meta` m
LEFT JOIN `tb_meta_lang` `ml` ON m.`id_meta` = ml.`id_meta`  AND ml.id_shop = 1 
ORDER BY LENGTH(ml.`url_rewrite`) DESC

	2.9 	224 	Yes 		/classes/Dispatcher.php:609

SELECT SQL_NO_CACHE h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`
FROM `tb_module` m
INNER JOIN tb_module_shop module_shop
ON (module_shop.id_module = m.id_module AND module_shop.id_shop = 1 AND module_shop.enable_device & 1)
INNER JOIN `tb_module_shop` ms ON ms.`id_module` = m.`id_module`
INNER JOIN `tb_hook_module` hm ON hm.`id_module` = m.`id_module`
INNER JOIN `tb_hook` h ON hm.`id_hook` = h.`id_hook`
WHERE (h.`name` != "displayPayment" AND h.`name` != "displayPaymentEU") AND (hm.`id_shop` = 1)
GROUP BY hm.id_hook, hm.id_module
ORDER BY hm.`position`

	2.7 	138 	Yes 	Yes 	/classes/Hook.php:588

SELECT SQL_NO_CACHE `id_hook`, `name`
FROM `tb_hook`
UNION
SELECT `id_hook`, ha.`alias` AS name
FROM `tb_hook_alias` ha
INNER JOIN `tb_hook` h ON ha.name = h.name

	2.3 	0 			/classes/Hook.php:731

SELECT SQL_NO_CACHE t.*, COALESCE(NULLIF(tl.`name`, ""), tl_def.`name`) AS `name`
FROM `tb_tab` t
LEFT JOIN `tb_tab_lang` `tl` ON t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = 1
LEFT JOIN `tb_tab_lang` `tl_def` ON t.`id_tab` = tl_def.`id_tab` AND tl_def.`id_lang` = 1
ORDER BY t.`position` ASC

	1.4 	106 	Yes 		/classes/Tab.php:227

SELECT SQL_NO_CACHE value FROM `tb_configuration` WHERE `name` = "PS_MULTISHOP_FEATURE_ACTIVE" LIMIT 1

	0.8 	2114 			/classes/shop/Shop.php:1304

SELECT SQL_NO_CACHE c.id_category, cl.name
FROM `tb_category` c
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
LEFT JOIN `tb_category_lang` cl ON c.`id_category` = cl.`id_category` AND cl.id_shop = 1 
RIGHT JOIN `tb_category` c2 ON c2.`id_category` = 2 AND c.`nleft` >= c2.`nleft` AND c.`nright` <= c2.`nright`
WHERE 1 AND `id_lang` = 5
ORDER BY c.`level_depth` ASC
, category_shop.`position` ASC

	0.7 	28 	Yes 		/classes/Category.php:291

SELECT SQL_NO_CACHE `id_tab`, `class_name`
FROM `tb_tab`

	0.6 	106 			/classes/Tab.php:135

SELECT SQL_NO_CACHE cg.`id_group`
FROM `tb_category_group` cg
WHERE (cg.`id_category` = 0)

	0.6 	1 			/classes/Category.php:2274

SELECT SQL_NO_CACHE gs.*, s.*, gs.`name` AS `group_name`, s.`name` AS `shop_name`, s.`active`,
su.`domain`, su.`domain_ssl`, su.`physical_uri`, su.`virtual_uri`
FROM `tb_shop_group` gs
LEFT JOIN `tb_shop` `s` ON s.`id_shop_group` = gs.`id_shop_group`
LEFT JOIN `tb_shop_url` `su` ON s.`id_shop` = su.`id_shop` AND su.`main` = 1
WHERE (s.`deleted` = 0) AND (gs.`deleted` = 0)
ORDER BY gs.`name`, s.`name`

	0.6 	1 	Yes 		/classes/shop/Shop.php:753

SELECT SQL_NO_CACHE *
FROM `tb_tab` a
LEFT JOIN `tb_tab_lang` `b` ON a.`id_tab` = b.`id_tab` AND b.`id_lang` = 1
WHERE (a.`id_tab` = 22) LIMIT 1

	0.6 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE m.`id_module`, m.`name`, ms.`id_module` AS `mshop`
FROM `tb_module` m
LEFT JOIN `tb_module_shop` `ms` ON ms.`id_module` = m.`id_module` AND ms.`id_shop` = 1

	0.5 	47 			/classes/module/Module.php:214

SELECT SQL_NO_CACHE s.`id_shop`, CONCAT(su.`physical_uri`, su.`virtual_uri`) AS `uri`, su.`domain`, su.`main`
FROM `tb_shop_url` su
LEFT JOIN `tb_shop` `s` ON s.`id_shop` = su.`id_shop`
WHERE (su.domain = 'www.xeniamode.de' OR su.domain_ssl = 'www.xeniamode.de') AND (s.`active` = 1) AND (s.`deleted` = 0)
ORDER BY LENGTH(CONCAT(su.`physical_uri`, su.`virtual_uri`)) DESC

	0.5 	1 	Yes 		/classes/shop/Shop.php:353

SELECT SQL_NO_CACHE COUNT(DISTINCT l.`id_lang`)
FROM `tb_lang` l
INNER JOIN `tb_lang_shop` ls ON ls.`id_lang` = l.`id_lang`
WHERE (ls.`id_shop` = 1) AND (l.`active` = 1) LIMIT 1

	0.5 	4 			/classes/Language.php:395

SELECT SQL_NO_CACHE DISTINCT g.`id_group`, g.`reduction`, g.`price_display_method`, gl.`name`
FROM `tb_group` g
LEFT JOIN `tb_group_lang` `gl` ON g.`id_group` = gl.`id_group` AND gl.`id_lang` = 1 INNER JOIN tb_group_shop group_shop
ON (group_shop.id_group = g.id_group AND group_shop.id_shop = 1)
ORDER BY g.`id_group` ASC

	0.5 	5 			/classes/Group.php:132

SELECT SQL_NO_CACHE *
FROM `tb_employee` a
LEFT JOIN `tb_employee_shop` `c` ON a.`id_employee` = c.`id_employee` AND c.`id_shop` = 1
WHERE (a.`id_employee` = 1) LIMIT 1

	0.5 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_image_type`
WHERE (`products` = 1)
ORDER BY `name` ASC

	0.5 	21 	Yes 		/classes/ImageType.php:156

SELECT SQL_NO_CACHE *
FROM `tb_country` a
LEFT JOIN `tb_country_shop` `c` ON a.`id_country` = c.`id_country` AND c.`id_shop` = 1
WHERE (a.`id_country` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_currency` a
LEFT JOIN `tb_currency_shop` `c` ON a.`id_currency` = c.`id_currency` AND c.`id_shop` = 1
WHERE (a.`id_currency` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE c.`id_category`, cl.`name`, cl.`link_rewrite`, category_shop.`id_shop`
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.id_shop = 1 )
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
WHERE `id_lang` = 5
AND c.`id_parent` = 2
GROUP BY c.`id_category`
ORDER BY category_shop.`position` ASC

	0.4 	12 	Yes 	Yes 	/classes/Category.php:560

SELECT SQL_NO_CACHE * FROM `tb_hook_alias`

	0.4 	86 			/classes/Hook.php:685

SELECT SQL_NO_CACHE *
FROM `tb_country` a
LEFT JOIN `tb_country_lang` `b` ON a.`id_country` = b.`id_country` AND b.`id_lang` = 1
LEFT JOIN `tb_country_shop` `c` ON a.`id_country` = c.`id_country` AND c.`id_shop` = 1
WHERE (a.`id_country` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_lang` a
LEFT JOIN `tb_lang_shop` `c` ON a.`id_lang` = c.`id_lang` AND c.`id_shop` = 1
WHERE (a.`id_lang` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE l.*, ls.`id_shop`
FROM `tb_lang` l
LEFT JOIN `tb_lang_shop` `ls` ON l.`id_lang` = ls.`id_lang`

	0.4 	2 			/classes/Language.php:177

SELECT SQL_NO_CACHE `id_employee`
FROM `tb_employee`
WHERE (`id_employee` = 1) AND (`active` = 1) AND (`passwd` = '$2y$10$dMUVBtC5zi8TX2xTU7pHsOR.HH9Ye4m1Z9QL9h6IcNNAhCU4/tSly') LIMIT 1

	0.4 	1 			/classes/Employee.php:635

SELECT SQL_NO_CACHE *
FROM `tb_quick_access` qa
LEFT JOIN `tb_quick_access_lang` `qal` ON qa.`id_quick_access` = qal.`id_quick_access`
WHERE (qal.`id_lang` = 1)
ORDER BY `name` ASC

	0.4 	4 	Yes 		/classes/QuickAccess.php:83

SELECT SQL_NO_CACHE *
FROM `tb_category` a
LEFT JOIN `tb_category_lang` `b` ON a.`id_category` = b.`id_category` AND b.`id_lang` = 1
LEFT JOIN `tb_category_shop` `c` ON a.`id_category` = c.`id_category` AND c.`id_shop` = 1
WHERE (a.`id_category` = 2) AND (b.`id_shop` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE c.id_category, "" AS name
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.id_shop = 1 )
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
WHERE `id_lang` = 5
AND c.`id_parent` = 15
LIMIT 1

	0.3 	7 			/classes/Category.php:598

SELECT SQL_NO_CACHE su.physical_uri, su.virtual_uri, su.domain, su.domain_ssl, t.id_theme, t.name, t.directory
FROM `tb_shop` s
LEFT JOIN `tb_shop_url` `su` ON s.`id_shop` = su.`id_shop`
LEFT JOIN `tb_theme` `t` ON t.`id_theme` = s.`id_theme`
WHERE (s.`id_shop` = 1) AND (s.`active` = 1) AND (s.`deleted` = 0) AND (su.`main` = 1) LIMIT 1

	0.3 	1 			/classes/shop/Shop.php:179

SELECT SQL_NO_CACHE *
FROM `tb_currency` c
INNER JOIN tb_currency_shop currency_shop
ON (currency_shop.id_currency = c.id_currency AND currency_shop.id_shop = 1)
WHERE (`deleted` = 0)
ORDER BY `name` ASC

	0.3 	1 	Yes 		/classes/Currency.php:354

SELECT SQL_NO_CACHE DISTINCT c.*
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = 1)
WHERE `level_depth` = 1

	0.3 	3 			/classes/Category.php:442

SELECT SQL_NO_CACHE c.id_category, "" AS name
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.id_shop = 1 )
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
WHERE `id_lang` = 5
AND c.`id_parent` = 26
LIMIT 1

	0.3 	1 			/classes/Category.php:598

SELECT SQL_NO_CACHE `name`
FROM `tb_image_type`

	0.3 	21 			/classes/ImageType.php:183

SELECT SQL_NO_CACHE *
FROM `tb_country_lang`
WHERE (`id_country` = 1)

	0.3 	8 			/Adapter/Adapter_EntityMapper.php:88

SELECT SQL_NO_CACHE *
FROM `tb_tab` t
LEFT JOIN `tb_tab_lang` `tl` ON t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = 1
WHERE (t.`id_tab` = 22) LIMIT 1

	0.3 	1 			/classes/Tab.php:437

SELECT SQL_NO_CACHE *
FROM `tb_category` a
LEFT JOIN `tb_category_shop` `c` ON a.`id_category` = c.`id_category` AND c.`id_shop` = 1
WHERE (a.`id_category` = 2) LIMIT 1

	0.3 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE UNIX_TIMESTAMP(last_flush) AS last_flush FROM `tb_smarty_last_flush` WHERE type='compile' LIMIT 1

	0.3 	1 			/classes/SmartyCustom.php:199

SELECT SQL_NO_CACHE `domain`, `domain_ssl`
FROM `tb_shop_url`
WHERE (`main` = 1) AND (`id_shop` = 1) LIMIT 1

	0.3 	1 			/classes/shop/ShopUrl.php:253

SELECT SQL_NO_CACHE *
FROM `tb_shop_group` a
WHERE (a.`id_shop_group` = 1) LIMIT 1

	0.3 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE COUNT(*) n
FROM `tb_module_shop`
WHERE (`id_module` = 103) AND (`id_shop` IN (1))
GROUP BY `id_module`
HAVING (n = 1) LIMIT 1

	0.3 	1 			/classes/module/Module.php:3109

SELECT SQL_NO_CACHE *
FROM `tb_hook_module_exceptions`
WHERE (`id_shop` IN (1))

	0.3 	1 			/classes/module/Module.php:3035

SELECT SQL_NO_CACHE *
FROM `tb_group_lang`
WHERE (`id_group` = 1)

	0.3 	8 			/Adapter/Adapter_EntityMapper.php:88

UPDATE `tb_employee` SET `last_connection_date` = CURRENT_DATE() WHERE `id_employee` = 1 AND `last_connection_date` < CURRENT_DATE()

	0.3 	1 			/classes/Employee.php:270

SELECT SQL_NO_CACHE c.id_category, "" AS name
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.id_shop = 1 )
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
WHERE `id_lang` = 5
AND c.`id_parent` = 16
LIMIT 1

	0.3 	3 			/classes/Category.php:598

SELECT SQL_NO_CACHE DISTINCT g.`id_group`, g.`reduction`, g.`price_display_method`, gl.`name`
FROM `tb_group` g
LEFT JOIN `tb_group_lang` `gl` ON g.`id_group` = gl.`id_group` AND gl.`id_lang` = 1
ORDER BY g.`id_group` ASC

	0.3 	5 			/classes/Group.php:132

SELECT SQL_NO_CACHE *
FROM `tb_category` a
LEFT JOIN `tb_category_lang` `b` ON a.`id_category` = b.`id_category` AND b.`id_lang` = 5
LEFT JOIN `tb_category_shop` `c` ON a.`id_category` = c.`id_category` AND c.`id_shop` = 1
WHERE (a.`id_category` = 2) AND (b.`id_shop` = 1) LIMIT 1

	0.3 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE COUNT(*) n
FROM `tb_module_shop`
WHERE (`id_module` = 30) AND (`id_shop` IN (1))
GROUP BY `id_module`
HAVING (n = 1) LIMIT 1

	0.2 	1 			/classes/module/Module.php:3109

SELECT SQL_NO_CACHE c.id_category, "" AS name
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.id_shop = 1 )
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
WHERE `id_lang` = 5
AND c.`id_parent` = 18
LIMIT 1

	0.2 	4 			/classes/Category.php:598

SELECT SQL_NO_CACHE *
FROM `tb_lang` a
LEFT JOIN `tb_lang_shop` `c` ON a.`id_lang` = c.`id_lang` AND c.`id_shop` = 1
WHERE (a.`id_lang` = 5) LIMIT 1

	0.2 	0 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_category_lang`
WHERE (`id_category` = 2) AND (`id_shop` = 1)

	0.2 	8 			/Adapter/Adapter_EntityMapper.php:88

SELECT SQL_NO_CACHE c.id_category, "" AS name
FROM `tb_category` c
LEFT JOIN `tb_category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.id_shop = 1 )
INNER JOIN tb_category_shop category_shop
ON (category_shop.id_category = c.id_category AND category_shop.id_shop = 1)
WHERE `id_lang` = 5
AND c.`id_parent` = 17
LIMIT 1

	0.2 	1 			/classes/Category.php:598

SELECT SQL_NO_CACHE *
FROM `tb_image_type`
WHERE (`categories` = 1)
ORDER BY `name` ASC

	0.2 	21 	Yes 		/classes/ImageType.php:156

SELECT SQL_NO_CACHE c.*, cl.*
FROM `tb_category` c
LEFT JOIN `tb_category_lang` `cl` ON c.`id_category` = cl.`id_category`
WHERE (`id_lang` = 5 AND cl.id_shop = 1 ) AND (c.`id_category` = 2) LIMIT 1

	0.2 	1 			/classes/Category.php:2222

SELECT SQL_NO_CACHE *
FROM `tb_group` a
LEFT JOIN `tb_group_shop` `c` ON a.`id_group` = c.`id_group` AND c.`id_shop` = 1
WHERE (a.`id_group` = 1) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_tab` t
LEFT JOIN `tb_tab_lang` `tl` ON t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = 1
WHERE (t.`id_tab` = 9) LIMIT 1

	0.2 	1 			/classes/Tab.php:437

SELECT SQL_NO_CACHE *
FROM `tb_theme` a
WHERE (a.`id_theme` = 2) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_group` a
LEFT JOIN `tb_group_shop` `c` ON a.`id_group` = c.`id_group` AND c.`id_shop` = 1
WHERE (a.`id_group` = 2) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE id_shop FROM `tb_employee_shop` WHERE `id_employee` = 1

	0.2 	1 			/classes/ObjectModel.php:1733

SELECT SQL_NO_CACHE *
FROM `tb_group_lang`
WHERE (`id_group` = 2)

	0.2 	8 			/Adapter/Adapter_EntityMapper.php:88

SELECT SQL_NO_CACHE *
FROM `tb_shop` a
WHERE (a.`id_shop` = 1) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_group_lang`
WHERE (`id_group` = 3)

	0.2 	8 			/Adapter/Adapter_EntityMapper.php:88

SELECT SQL_NO_CACHE `id_parent`
FROM `tb_tab`
WHERE (LOWER(`class_name`) = 'admincategories') LIMIT 1

	0.2 	106 			/classes/Tab.php:162

SELECT SQL_NO_CACHE `class_name`
FROM `tb_tab`
WHERE (`id_tab` = 1) LIMIT 1

	0.2 	1 			/classes/Tab.php:589

SELECT SQL_NO_CACHE `id_module`, `name`
FROM `tb_module`

	0.2 	47 			/classes/module/Module.php:1766

SELECT SQL_NO_CACHE c.`id_category`, cl.`name`, cl.`link_rewrite`, cl.`id_lang`
FROM `tb_category` c
LEFT JOIN `tb_category_lang` `cl` ON c.`id_category` = cl.`id_category`  AND cl.id_shop = 1 
WHERE (cl.`id_lang` = 5) AND (c.`id_category` IN (2))

	0.2 	1 			/classes/Category.php:1055

SELECT SQL_NO_CACHE *
FROM `tb_group` a
LEFT JOIN `tb_group_shop` `c` ON a.`id_group` = c.`id_group` AND c.`id_shop` = 1
WHERE (a.`id_group` = 3) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE COUNT(*) n
FROM `tb_module_shop`
WHERE (`id_module` = 136) AND (`id_shop` IN (1))
GROUP BY `id_module`
HAVING (n = 1) LIMIT 1

	0.2 	1 			/classes/module/Module.php:3109

SELECT SQL_NO_CACHE id_shop
FROM `tb_category_shop`
WHERE `id_category` = 2
AND id_shop = 1 LIMIT 1

Profile for new product (no interaction with category tables):

Stopwatch SQL - 50 queries
Query 	Time (ms) 	Rows 	Filesort 	Group By 	Location

SELECT SQL_NO_CACHE c.`name`, cl.`id_lang`, IFNULL(cl.`value`, c.`value`) AS `value`, c.`id_shop_group`, c.`id_shop`
FROM `tb_configuration` c
LEFT JOIN `tb_configuration_lang` `cl` ON c.`id_configuration` = cl.`id_configuration`

	8.6 	2114 			/classes/Configuration.php:437

SELECT SQL_NO_CACHE `id_hook`, `name`
FROM `tb_hook`
UNION
SELECT `id_hook`, ha.`alias` AS name
FROM `tb_hook_alias` ha
INNER JOIN `tb_hook` h ON ha.name = h.name

	2.2 	0 			/classes/Hook.php:731

SELECT SQL_NO_CACHE m.`page`, ml.`url_rewrite`, ml.`id_lang`
FROM `tb_meta` m
LEFT JOIN `tb_meta_lang` `ml` ON m.`id_meta` = ml.`id_meta`  AND ml.id_shop = 1 
ORDER BY LENGTH(ml.`url_rewrite`) DESC

	2 	224 	Yes 		/classes/Dispatcher.php:609

SELECT SQL_NO_CACHE h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit`
FROM `tb_module` m
INNER JOIN tb_module_shop module_shop
ON (module_shop.id_module = m.id_module AND module_shop.id_shop = 1 AND module_shop.enable_device & 1)
INNER JOIN `tb_module_shop` ms ON ms.`id_module` = m.`id_module`
INNER JOIN `tb_hook_module` hm ON hm.`id_module` = m.`id_module`
INNER JOIN `tb_hook` h ON hm.`id_hook` = h.`id_hook`
WHERE (h.`name` != "displayPayment" AND h.`name` != "displayPaymentEU") AND (hm.`id_shop` = 1)
GROUP BY hm.id_hook, hm.id_module
ORDER BY hm.`position`

	1.9 	138 	Yes 	Yes 	/classes/Hook.php:588

SELECT SQL_NO_CACHE t.*, COALESCE(NULLIF(tl.`name`, ""), tl_def.`name`) AS `name`
FROM `tb_tab` t
LEFT JOIN `tb_tab_lang` `tl` ON t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = 1
LEFT JOIN `tb_tab_lang` `tl_def` ON t.`id_tab` = tl_def.`id_tab` AND tl_def.`id_lang` = 1
ORDER BY t.`position` ASC

	1.4 	106 	Yes 		/classes/Tab.php:227

SELECT SQL_NO_CACHE su.physical_uri, su.virtual_uri, su.domain, su.domain_ssl, t.id_theme, t.name, t.directory
FROM `tb_shop` s
LEFT JOIN `tb_shop_url` `su` ON s.`id_shop` = su.`id_shop`
LEFT JOIN `tb_theme` `t` ON t.`id_theme` = s.`id_theme`
WHERE (s.`id_shop` = 1) AND (s.`active` = 1) AND (s.`deleted` = 0) AND (su.`main` = 1) LIMIT 1

	1.2 	1 			/classes/shop/Shop.php:179

SELECT SQL_NO_CACHE t.`id_lang`, t.`name`
FROM `tb_tag` t
LEFT JOIN `tb_product_tag` `pt` ON pt.`id_tag` = t.`id_tag`
WHERE (pt.`id_product` = 0)

	1.2 	1 			/classes/Tag.php:331

SELECT SQL_NO_CACHE *
FROM `tb_quick_access` qa
LEFT JOIN `tb_quick_access_lang` `qal` ON qa.`id_quick_access` = qal.`id_quick_access`
WHERE (qal.`id_lang` = 1)
ORDER BY `name` ASC

	0.9 	4 	Yes 		/classes/QuickAccess.php:83

SELECT SQL_NO_CACHE *
FROM `tb_currency` c
INNER JOIN tb_currency_shop currency_shop
ON (currency_shop.id_currency = c.id_currency AND currency_shop.id_shop = 1)
WHERE (`deleted` = 0)
ORDER BY `name` ASC

	0.7 	1 	Yes 		/classes/Currency.php:354

SELECT SQL_NO_CACHE `id_product_attribute`
FROM `tb_product_attribute`
WHERE `id_product` = 0

	0.6 	1 			/classes/Product.php:5764

SELECT SQL_NO_CACHE value FROM `tb_configuration` WHERE `name` = "PS_MULTISHOP_FEATURE_ACTIVE" LIMIT 1

	0.6 	2114 			/classes/shop/Shop.php:1304

SELECT SQL_NO_CACHE *
FROM `tb_tab` t
LEFT JOIN `tb_tab_lang` `tl` ON t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = 1
WHERE (t.`id_tab` = 21) LIMIT 1

	0.5 	1 			/classes/Tab.php:437

SELECT SQL_NO_CACHE COUNT(*) n
FROM `tb_module_shop`
WHERE (`id_module` = 103) AND (`id_shop` IN (1))
GROUP BY `id_module`
HAVING (n = 1) LIMIT 1

	0.5 	1 			/classes/module/Module.php:3109

SELECT SQL_NO_CACHE `id_parent`
FROM `tb_tab`
WHERE (LOWER(`class_name`) = 'adminproducts') LIMIT 1

	0.5 	106 			/classes/Tab.php:162

UPDATE `tb_employee` SET `last_connection_date` = CURRENT_DATE() WHERE `id_employee` = 1 AND `last_connection_date` < CURRENT_DATE()

	0.5 	1 			/classes/Employee.php:270

SELECT SQL_NO_CACHE t.`class_name`, t.`module`
FROM `tb_tab` t
WHERE (t.`module` IS NOT NULL) AND (t.`module` != "")

	0.5 	106 			/classes/Tab.php:191

SELECT SQL_NO_CACHE *
FROM `tb_tab` a
LEFT JOIN `tb_tab_lang` `b` ON a.`id_tab` = b.`id_tab` AND b.`id_lang` = 1
WHERE (a.`id_tab` = 21) LIMIT 1

	0.5 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE gs.*, s.*, gs.`name` AS `group_name`, s.`name` AS `shop_name`, s.`active`,
su.`domain`, su.`domain_ssl`, su.`physical_uri`, su.`virtual_uri`
FROM `tb_shop_group` gs
LEFT JOIN `tb_shop` `s` ON s.`id_shop_group` = gs.`id_shop_group`
LEFT JOIN `tb_shop_url` `su` ON s.`id_shop` = su.`id_shop` AND su.`main` = 1
WHERE (s.`deleted` = 0) AND (gs.`deleted` = 0)
ORDER BY gs.`name`, s.`name`

	0.5 	1 	Yes 		/classes/shop/Shop.php:753

SELECT SQL_NO_CACHE m.`id_module`, m.`name`, ms.`id_module` AS `mshop`
FROM `tb_module` m
LEFT JOIN `tb_module_shop` `ms` ON ms.`id_module` = m.`id_module` AND ms.`id_shop` = 1

	0.4 	47 			/classes/module/Module.php:214

SELECT SQL_NO_CACHE COUNT(*) n
FROM `tb_module_shop`
WHERE (`id_module` = 30) AND (`id_shop` IN (1))
GROUP BY `id_module`
HAVING (n = 1) LIMIT 1

	0.4 	1 			/classes/module/Module.php:3109

SELECT SQL_NO_CACHE *
FROM `tb_tab` t
LEFT JOIN `tb_tab_lang` `tl` ON t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = 1
WHERE (t.`id_tab` = 9) LIMIT 1

	0.4 	1 			/classes/Tab.php:437

SELECT SQL_NO_CACHE *
FROM `tb_employee` a
LEFT JOIN `tb_employee_shop` `c` ON a.`id_employee` = c.`id_employee` AND c.`id_shop` = 1
WHERE (a.`id_employee` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE COUNT(*) n
FROM `tb_module_shop`
WHERE (`id_module` = 136) AND (`id_shop` IN (1))
GROUP BY `id_module`
HAVING (n = 1) LIMIT 1

	0.4 	1 			/classes/module/Module.php:3109

SELECT SQL_NO_CACHE *
FROM `tb_shop_group` a
WHERE (a.`id_shop_group` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE `id_employee`
FROM `tb_employee`
WHERE (`id_employee` = 1) AND (`active` = 1) AND (`passwd` = '$2y$10$dMUVBtC5zi8TX2xTU7pHsOR.HH9Ye4m1Z9QL9h6IcNNAhCU4/tSly') LIMIT 1

	0.4 	1 			/classes/Employee.php:635

SELECT SQL_NO_CACHE *
FROM `tb_currency` a
LEFT JOIN `tb_currency_shop` `c` ON a.`id_currency` = c.`id_currency` AND c.`id_shop` = 1
WHERE (a.`id_currency` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_image_type`
WHERE (`products` = 1)
ORDER BY `name` ASC

	0.4 	21 	Yes 		/classes/ImageType.php:156

SELECT SQL_NO_CACHE *
FROM `tb_country` a
LEFT JOIN `tb_country_shop` `c` ON a.`id_country` = c.`id_country` AND c.`id_shop` = 1
WHERE (a.`id_country` = 1) LIMIT 1

	0.4 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE s.`id_shop`, CONCAT(su.`physical_uri`, su.`virtual_uri`) AS `uri`, su.`domain`, su.`main`
FROM `tb_shop_url` su
LEFT JOIN `tb_shop` `s` ON s.`id_shop` = su.`id_shop`
WHERE (su.domain = 'www.xeniamode.de' OR su.domain_ssl = 'www.xeniamode.de') AND (s.`active` = 1) AND (s.`deleted` = 0)
ORDER BY LENGTH(CONCAT(su.`physical_uri`, su.`virtual_uri`)) DESC

	0.4 	1 	Yes 		/classes/shop/Shop.php:353

SELECT SQL_NO_CACHE COUNT(DISTINCT l.`id_lang`)
FROM `tb_lang` l
INNER JOIN `tb_lang_shop` ls ON ls.`id_lang` = l.`id_lang`
WHERE (ls.`id_shop` = 1) AND (l.`active` = 1) LIMIT 1

	0.4 	4 			/classes/Language.php:395

SELECT SQL_NO_CACHE *
FROM `tb_image` i
LEFT JOIN `tb_image_lang` `il` ON i.`id_image` = il.`id_image`
WHERE (i.`id_product` = 0) AND (il.`id_lang` = 1)
ORDER BY i.`position` ASC

	0.3 	1 	Yes 		/classes/Image.php:178

SELECT SQL_NO_CACHE COUNT(*)
FROM `tb_product_attribute` pa
INNER JOIN tb_product_attribute_shop product_attribute_shop
ON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop = 1)
WHERE (pa.`id_product` = 0) LIMIT 1

	0.3 	1 			/classes/Product.php:5819

SELECT SQL_NO_CACHE `id_tab`, `class_name`
FROM `tb_tab`

	0.3 	106 			/classes/Tab.php:135

SELECT SQL_NO_CACHE *
FROM `tb_country` a
LEFT JOIN `tb_country_lang` `b` ON a.`id_country` = b.`id_country` AND b.`id_lang` = 1
LEFT JOIN `tb_country_shop` `c` ON a.`id_country` = c.`id_country` AND c.`id_shop` = 1
WHERE (a.`id_country` = 1) LIMIT 1

	0.3 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_country_lang`
WHERE (`id_country` = 1)

	0.3 	8 			/Adapter/Adapter_EntityMapper.php:88

SELECT SQL_NO_CACHE DISTINCT pl.name as name
FROM `tb_product_lang` pl
WHERE (pl.id_product = 0) AND (pl.id_lang = 1 AND pl.id_shop = 1 ) LIMIT 1

	0.3 	0 			/classes/Product.php:3707

SELECT SQL_NO_CACHE * FROM `tb_hook_alias`

	0.3 	86 			/classes/Hook.php:685

SELECT SQL_NO_CACHE `id_product_download`
FROM `tb_product_download`
WHERE (`id_product` = 0) AND (`active` = 1)
ORDER BY `id_product_download` DESC LIMIT 1

	0.3 	0 			/classes/ProductDownload.php:138

SELECT SQL_NO_CACHE `id_module`, `name`
FROM `tb_module`

	0.3 	47 			/classes/module/Module.php:1766

SELECT SQL_NO_CACHE `class_name`
FROM `tb_tab`
WHERE (`id_tab` = 1) LIMIT 1

	0.3 	1 			/classes/Tab.php:589

SELECT SQL_NO_CACHE l.*, ls.`id_shop`
FROM `tb_lang` l
LEFT JOIN `tb_lang_shop` `ls` ON l.`id_lang` = ls.`id_lang`

	0.3 	2 			/classes/Language.php:177

SELECT SQL_NO_CACHE UNIX_TIMESTAMP(last_flush) AS last_flush FROM `tb_smarty_last_flush` WHERE type='compile' LIMIT 1

	0.3 	1 			/classes/SmartyCustom.php:199

SELECT SQL_NO_CACHE `domain`, `domain_ssl`
FROM `tb_shop_url`
WHERE (`main` = 1) AND (`id_shop` = 1) LIMIT 1

	0.3 	1 			/classes/shop/ShopUrl.php:253

SELECT SQL_NO_CACHE *
FROM `tb_hook_module_exceptions`
WHERE (`id_shop` IN (1))

	0.2 	1 			/classes/module/Module.php:3035

SELECT SQL_NO_CACHE `id_module`
FROM `tb_module_shop`
WHERE (`id_module` = 92) AND (`id_shop` = 1) LIMIT 1

	0.2 	1 			/classes/module/Module.php:1508

SELECT SQL_NO_CACHE *
FROM `tb_shop` a
WHERE (a.`id_shop` = 1) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_lang` a
LEFT JOIN `tb_lang_shop` `c` ON a.`id_lang` = c.`id_lang` AND c.`id_shop` = 1
WHERE (a.`id_lang` = 5) LIMIT 1

	0.2 	0 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_lang` a
LEFT JOIN `tb_lang_shop` `c` ON a.`id_lang` = c.`id_lang` AND c.`id_shop` = 1
WHERE (a.`id_lang` = 1) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE *
FROM `tb_theme` a
WHERE (a.`id_theme` = 2) LIMIT 1

	0.2 	1 			/Adapter/Adapter_EntityMapper.php:80

SELECT SQL_NO_CACHE id_shop FROM `tb_employee_shop` WHERE `id_employee` = 1

	0.2 	1 			/classes/ObjectModel.php:1733

 

  • 0
Posted

Repeated the same procedure on the 2nd store where category selection works for new products. And here the same, no interaction with category tables.

In summary, it should be some other function that is responsible for viewing category options. Is it some java function?

Hope for some feedback from the core team...;(

  • 0
Posted (edited)

anybody there?

I identified that the tree structure comes from the JS located in /admin/themes/default/js/tree.js. The basic question is still why the categories are missing for new products...

Hope to receive some troubleshoot tips at least. Thx

Edited by ALM
  • 0
Posted

Ideas enough:

 - look for php errors, both in the log files and by enabling debug mode

 - look for javascript errors

 - run the Prestools integrity checks

 - compare your files in the admin, classes and controllers directories with those of a fresh TB installation of the same version. I use Winmerge for that.

  • 0
Posted

A little theory about the category tree structure might help:

 - categories form a tree under the root category. 

 - A shop has assigned a Home category, typically one level below the root. Its tree is only what is below the Home.

 - So other categories directly below the root are not visible. They can be used for multishop. They are sometimes also used for categories that people want to keep outside the tree, like Sales. Such a category can then only be reached directly.

 - The position of a category within the tree is determined by the id_parent and position fields. When id_parent points to a non-existing category it and it child categories will be invisible. Such a thing can happen due to timeouts.

 - As some people working directly on the database have discovered the hard way, id_parent and position don't work by themselves. Prestashop and Thirty Bees create an Ntree using them and that ntree (embodied in the fields nleft and nright) is what is consulted by most database operations. This Ntree is recreated after every change in the tree structure. So an easy way to trigger a recreation of the ntree is changing the order of two subcategories within a category. Sometimes you can solve problems that way.

 - I haven't studied the multishop effects on the categories. For example what happens when you don't assign a category in the middle of a tree to one shop. And I don't understand the role of the position field in the tb_category_shop table as nleft and nright are in the tb_category table.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...