1054 error after deleting custom field

  • Posts: 377
  • Thank you received: 7
10 years 5 months ago #159897

-- url of the page with the problem -- : rapiddeal.co.uk/dev2/bournemouth
-- HikaShop version -- :2.3.1
-- Joomla version -- : 3.3.0

For some reason after deleting a custom field i am now getting a 1054 error on my menu link to those items. The products themselves display ok on their pages and the homepage is fine but i am getting an odd error on the product / category listing page.

Kind regards

Alex

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

  • Posts: 12953
  • Thank you received: 1778
10 years 5 months ago #159907

Hello Alex,
Reading that documentation will probably help you : www.hikashop.com/support/support/documen...lity-issues.html#SQL

500 - JDatabaseMySQL::query: 1054 - Unknown column 'XXXXXX' in 'where clause' SQL=SELECT * FROM.....
How to fix (for update issues)?
You should open the file administrator/components/com_hikashop/install.hikashop.php and search for that column name. You should see something like that:

$this->db->setQuery("ALTER TABLE `#__hikashop_YYYY` ADD `XXXXXXXX` .....................................................");
$this->db->query();

You need to open your phpmyadmin and run the query which is in the double quotes in your database. Don't forget to replace #__ by the prefix of your tables (it's usually jos_ for Joomla 1.5 but it is random for Joomla > 1.6 ).

For custom fields, you can just delete them and the error should disappear.
How to avoid problems later on ?
You should make sure that your MySQL user has the ALTER privilege. If you don't know how to do that, you should ask your hosting company.

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

  • Posts: 377
  • Thank you received: 7
10 years 5 months ago #160026

Hi Mohammed,

Thanks for your reply, I checked the tables and under your documentation it states with custom fields just delete the custom field. I have checked the hikashop_field table and the custom field doesnt seem to be in there would it be somewhere else?

Also your documentation says this comes from the user not having the alter priveledge and the server is dedicated so not lacking in resources.

The only ALTER queries i found in that file are:

$this->db->setQuery("ALTER TABLE `#__hikashop_vote` CHANGE `vote_comment` `vote_comment` TEXT NOT NULL;");
$this->db->setQuery("ALTER TABLE `#__hikashop_payment` DROP INDEX payment_type");
$this->db->setQuery("ALTER TABLE `#__hikashop_download` DROP PRIMARY KEY , ADD PRIMARY KEY ( `file_id` , `order_id` , `file_pos` );");
$this->db->setQuery("ALTER TABLE `#__hikashop_field` CHANGE `field_value` `field_value` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");

There doesn't seem to be anything there which relates to the hikashop field either.
I think what i might do is simply restore this from backup and not delete the custom field! I think I will just unpublish it!

Thanks

Alex

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

  • Posts: 12953
  • Thank you received: 1778
10 years 5 months ago #160062

I think what i might do is simply restore this from backup and not delete the custom field! I think I will just unpublish it!

Sure, unpublishing custom field is always better than directly deleting them.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum