[Skip to main content](#vessel-content)

#   Useless IS NULL check on menu item load

##

- **[Denitz](/forum/user/42054-denitz "View Denitz's Profile")**
- [![Denitz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/42054-denitz "View Denitz's Profile") Topic Author
- [ Offline](/forum/user/42054-denitz)

Less More

- Posts: 31
- Thank you received: 2
-
-

2 months 1 day ago -  2 months 1 day ago [\#373351](#373351) by [Denitz](/forum/user/42054-denitz "View Denitz's Profile")  *[Useless IS NULL check on menu item load](/forum/25-install-update/910813-useless-is-null-check-on-menu-item-load#373351 "-- HikaShop version -- : 6.6.0 -- Joomla version -- : 6.1.3 -- PHP version -- : 8.4  hikashopMenusClass filters all loaded menu items via &quot;b.title IS NOT NULL&quot; where &quot;b&quot; is as alias of &quot;#&#95;&#95;menu&#95;types&quot; table.  &quot;#&#95;&#95;menu&#95;types.title&quot; is not a nullable column, hence this clause makes no sense, and join to #&#95;&#95;menu&#95;types is also completely useless.  Sorry, posted to incorrect forum, please move to Bugs.")* was created by *[Denitz](/forum/user/42054-denitz "View Denitz's Profile")*

-- HikaShop version -- : 6.6.0
-- Joomla version -- : 6.1.3
-- PHP version -- : 8.4

hikashopMenusClass filters all loaded menu items via "b.title IS NOT NULL" where "b" is as alias of "#__menu_types" table.

"#__menu_types.title" is not a nullable column, hence this clause makes no sense, and join to #__menu_types is also completely useless.

Sorry, posted to incorrect forum, please move to Bugs.

Last edit: 2 months 1 day ago by [Denitz](/forum/user/42054-denitz "View Denitz's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkxMDgxMy11c2VsZXNzLWlzLW51bGwtY2hlY2stb24tbWVudS1pdGVtLWxvYWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86363
- Thank you received: 14296
-
-

2 months 22 hours ago [\#373353](#373353) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Useless IS NULL check on menu item load](/forum/25-install-update/910813-useless-is-null-check-on-menu-item-load#373353 "-- HikaShop version -- : 6.6.0 -- Joomla version -- : 6.1.3 -- PHP version -- : 8.4  hikashopMenusClass filters all loaded menu items via &quot;b.title IS NOT NULL&quot; where &quot;b&quot; is as alias of &quot;#&#95;&#95;menu&#95;types&quot; table.  &quot;#&#95;&#95;menu&#95;types.title&quot; is not a nullable column, hence this clause makes no sense, and join to #&#95;&#95;menu&#95;types is also completely useless.  Sorry, posted to incorrect forum, please move to Bugs.")*

Hi,

You're right on the IS NOT NULL, and I've removed it from the three queries in hikashopMenusClass, plus the two other places which had the same copy (the menu item lookup in the helper and the Smart Search plugin). It will be in the next version.

A bit of history, since it explains the shape: that filter was added in 2014 next to a LEFT JOIN, where it was the way to drop a menu item pointing at a menu type which no longer exists. The join was changed to INNER the same day and the test has done nothing since.

The join itself I'm keeping, as that is what now does the filtering the NULL test used to do: an INNER JOIN on #__menu_types excludes the menu items whose menutype has no row there. That shouldn't happen on a healthy site, but we do see databases where a menu was removed and its items stayed behind, and picking one of those for an Itemid gives a link which 404s.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkxMDgxMy11c2VsZXNzLWlzLW51bGwtY2hlY2stb24tbWVudS1pdGVtLWxvYWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Denitz](/forum/user/42054-denitz "View Denitz's Profile")**
- [![Denitz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/42054-denitz "View Denitz's Profile") Topic Author
- [ Offline](/forum/user/42054-denitz)

Less More

- Posts: 31
- Thank you received: 2
-
-

2 months 21 hours ago [\#373360](#373360) by [Denitz](/forum/user/42054-denitz "View Denitz's Profile")  Replied by *[Denitz](/forum/user/42054-denitz "View Denitz's Profile")* on topic *[Useless IS NULL check on menu item load](/forum/25-install-update/910813-useless-is-null-check-on-menu-item-load#373360 "-- HikaShop version -- : 6.6.0 -- Joomla version -- : 6.1.3 -- PHP version -- : 8.4  hikashopMenusClass filters all loaded menu items via &quot;b.title IS NOT NULL&quot; where &quot;b&quot; is as alias of &quot;#&#95;&#95;menu&#95;types&quot; table.  &quot;#&#95;&#95;menu&#95;types.title&quot; is not a nullable column, hence this clause makes no sense, and join to #&#95;&#95;menu&#95;types is also completely useless.  Sorry, posted to incorrect forum, please move to Bugs.")*

Thanks!
Imho, this join is still useless, the problems of broken sites should be not projected on all other sites.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkxMDgxMy11c2VsZXNzLWlzLW51bGwtY2hlY2stb24tbWVudS1pdGVtLWxvYWQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
