Unable install Hikashop after Joomla update to 4.2.5

  • Posts: 3
  • Thank you received: 0
1 year 11 months ago #347276

-- Joomla version -- : 4.2.5
-- PHP version -- : 8.0.21
-- Browser(s) name and version -- : Firefox 107.0.1
-- Error-message(debug-mod must be tuned on) -- : Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='

Hi all,
I am trying to install hikashop, but i get this error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '='
Anyone know how to fix?

Thank you all

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347280

Hi,

I'm not sure since I was never able to reproduce the problem.
However, let's try:
- extract the HikaShop install package on your local computer.
- edit the file back/helpers/database.php and change the line:

$query = 'UPDATE `#__hikashop_user` AS hku LEFT JOIN `#__users` AS ju ON hku.`user_email`=ju.`email` SET hku.`user_cms_id`=ju.`id` WHERE hku.`user_cms_id`!=ju.`id`';
to:
$query = 'UPDATE `#__hikashop_user` AS hku LEFT JOIN `#__users` AS ju ON (hku.`user_email`=ju.`email` COLLATE utf8mb4_general_ci) SET hku.`user_cms_id`=ju.`id` WHERE hku.`user_cms_id`!=ju.`id`';
- zip again all the files/folders in a new install zip
- install the modified zip
Let us know if it works of if you get an error.
If it works, we could include this change to avoid that error when there is a mix of collations (I suppose because of old Joomla table collations, or database setup).

The following user(s) said Thank You: brustolino

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

  • Posts: 3
  • Thank you received: 0
1 year 11 months ago #347292

Thanks for the reply, but now it gives the following error:
COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'utf8

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347303

Hi,

In that case I'm not sure what would be a solution there we could include in HikaShop.
As a quick fix for your situation, you can just remove the whole block of code:

$query = 'INSERT IGNORE INTO `#__hikashop_user` (`user_email`,`user_cms_id`,`user_created`) SELECT `email`, `id`,'.time().' FROM `#__users`';
		$this->db->setQuery($query);
		try{
			$result = $this->db->execute();
			if($result){
				$ret[] = array(
					'success',
					'Joomla users synchronized'
				);
			}
		} catch(Exception $e) {
			$ret[] = array(
				'error',
				$e->getMessage()
			);
		}
from there and run the installation again. It will circumvent the problem. That MySQL query is there for migrations between two websites so that HikaShop can resynchronize the user's id if they changed in Joomla compared to what they were before. So it won't change anything normally.

The following user(s) said Thank You: brustolino

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

  • Posts: 3
  • Thank you received: 0
1 year 11 months ago #347305

Same error... :(
COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'utf8

Omg ;_;

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347313

Hi,

You can't have that error message if you removed the block of code since the "collation utf8mb4_general_ci" comes from the modified MySQL query you've added in there.
So it means you must have made a mistake in the process when modifying the code and zipping again all the files of the install package, or you used the wrong install package.

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

Time to create page: 0.051 seconds
Powered by Kunena Forum