Error creating TAGS

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321624

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- Browser(s) name and version -- : FireFox

Hi

When I try to add a tag to a product and save, I get this error:

An error has occurred.
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 9 months ago #321627

Hi,

First please do this modification:
www.hikashop.com/support/forum/product-c...eld-list.html#304882
That way, the full MySQL query will be displayed in the error message.
It will help understand what's going on.
Then, you can also activate the "debug mode" and "error reporting" settings of the Joomla configuration and try again.
It will add the call stack debug data which will also help us understand what's going on.

Please Log in or Create an account to join the conversation.

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321644

Hi

With the first option, I get this:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 INSERT INTO of4x3k_contentitem_tag_map

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 9 months ago #321654

Hi,

Could you also activate the "debug mode" and "error reporting" settings of the Joomla configuration and try again ?
It will add the call stack debug data which will also help us understand what's going on.

Please Log in or Create an account to join the conversation.

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321663

Sure!

Getting this:

An error has occurred.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 INSERT INTO of4x3k_contentitem_tag_map
/var/www/vhosts/mugge-p.dk/httpdocs/libraries/joomla/database/driver/mysqli.php:665

Call stack
# Function Location
1 () JROOT/libraries/joomla/database/driver/mysqli.php:665
2 JDatabaseDriverMysqli->execute() JROOT/libraries/src/Helper/TagsHelper.php:104
3 Joomla\CMS\Helper\TagsHelper->addTagMapping() JROOT/libraries/src/Helper/TagsHelper.php:1062
4 Joomla\CMS\Helper\TagsHelper->tagItem() JROOT/libraries/src/Helper/TagsHelper.php:860
5 Joomla\CMS\Helper\TagsHelper->postStoreProcess() JROOT/administrator/components/com_hikashop/helpers/tags.php:119
6 HikaShopTagsHelper->saveUCM() JROOT/administrator/components/com_hikashop/classes/product.php:2702
7 hikashopProductClass->fullSave() JROOT/administrator/components/com_hikashop/classes/product.php:665
8 hikashopProductClass->backSaveForm() JROOT/administrator/components/com_hikashop/classes/product.php:50
9 hikashopProductClass->saveForm() JROOT/administrator/components/com_hikashop/helpers/helper.php:2014
10 hikashopController->store() JROOT/administrator/components/com_hikashop/helpers/helper.php:1954
11 hikashopController->apply() JROOT/libraries/src/MVC/Controller/BaseController.php:710
12 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2178
13 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:72
14 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
15 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
16 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
17 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
18 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:196
19 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 9 months ago #321678

Hi,

Thanks for the debug information.
From what I can see it happens in the file /libraries/src/Helper/TagsHelper.php because it's trying to execute a query it shouldn't.
Now I don't know why this is happening on your website. It's not happening on mine when I do the same, and checking the code of that file, I actually don't see why it would execute that MySQL query.

I suppose adding a check before that MySQL query would be great and probably fix the problem, but I don't see why it does that.

Try adding the code:
if(empty($tags) || !is_array($tags) || !count($tags)) return true;
before the line:
if (strpos('#', implode(',', $tags)) === false)
in the file /libraries/src/Helper/TagsHelper.php
and see how it goes.

Please Log in or Create an account to join the conversation.

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321696

Thanks, but same result:

An error has occurred.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 INSERT INTO of4x3k_contentitem_tag_map
/var/www/vhosts/mugge-p.dk/httpdocs/libraries/joomla/database/driver/mysqli.php:665

Call stack
# Function Location
1 () JROOT/libraries/joomla/database/driver/mysqli.php:665
2 JDatabaseDriverMysqli->execute() JROOT/libraries/src/Helper/TagsHelper.php:105
3 Joomla\CMS\Helper\TagsHelper->addTagMapping() JROOT/libraries/src/Helper/TagsHelper.php:1063
4 Joomla\CMS\Helper\TagsHelper->tagItem() JROOT/libraries/src/Helper/TagsHelper.php:861
5 Joomla\CMS\Helper\TagsHelper->postStoreProcess() JROOT/administrator/components/com_hikashop/helpers/tags.php:119
6 HikaShopTagsHelper->saveUCM() JROOT/administrator/components/com_hikashop/classes/product.php:2702
7 hikashopProductClass->fullSave() JROOT/administrator/components/com_hikashop/classes/product.php:665
8 hikashopProductClass->backSaveForm() JROOT/administrator/components/com_hikashop/classes/product.php:50
9 hikashopProductClass->saveForm() JROOT/administrator/components/com_hikashop/helpers/helper.php:2014
10 hikashopController->store() JROOT/administrator/components/com_hikashop/helpers/helper.php:1954
11 hikashopController->apply() JROOT/libraries/src/MVC/Controller/BaseController.php:710
12 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2178
13 hikashopController->execute() JROOT/administrator/components/com_hikashop/hikashop.php:72
14 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
15 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
16 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:101
17 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:159
18 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:196
19 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/index.php:51

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 9 months ago #321714

Hi,

Then I'm not sure. I think we'll need a backend and a FTP access in order to replicate the issue and add extra debugging there to figure out what's going on.
Could you provide that along with a link to this thread via our contact form ?
www.hikashop.com/support/contact-us.html

Please Log in or Create an account to join the conversation.

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321717

Hi

Of course!

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 9 months ago #321725

Hi,

We got your FTP access but your message didn't include the backend access.
Could you provide that too please ?

Please Log in or Create an account to join the conversation.

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321730

Sorry, sending it right away!

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
3 years 9 months ago #321863

Hi,

Well, I did some debugging in the code and I think I found the problem.
You have a problem with the installation of com_tags (the joomla component handling the tags on your website).
If you try to create a new tag via the Components>Tags menu, you'll get that error:

Save failed with the following error: TagsTableTag::_getNode(1, ) failed.

This error is referenced here:
forum.joomla.org/viewtopic.php?t=800583
Which indicates a solution to the issue is to run a MySQL query via your PHPMyAdmin.

Please Log in or Create an account to join the conversation.

  • Posts: 357
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 9 months ago #321869

Thanks a lot!

Tried the query and now I can make tags i HikaShop :-)

The following user(s) said Thank You: Philip

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum