Check that the version of this patch matches the version of your K2 component. It will not work on any other version.
Back up your Joomla files before applying this patch.
Contact us if you have any questions or need help installing the k2 multi categories patch.
Step 1 - Copy the content of zip file over the files in your Joomla directory.
Step 2 - (needs to be done once) replace #_ in the following SQL queries with your data base prefix and run those on Joomla's database. This step needs to be done only once. Skip it if you upgrading from a previous version.
Create a table to store k2 multi category refferences
CREATE TABLE IF NOT EXISTS `#__k2_items_category_ref` ( `catid` int(11) NOT NULL, `itemid` int(11) NOT NULL, PRIMARY KEY (`catid`,`itemid`), KEY `catid` (`catid`), KEY `itemid` (`itemid`) );
Run the following SQL query to copy existing categories references into the new table:
INSERT INTO #__k2_items_category_ref (itemid, catid) SELECT c.id, c.catid FROM #__k2_items c;
Note: you will need to replace
#_ with the prefix used in your Joomla install
Step 3 - update your language file
You will also need to add the following lines to your language file(s) (ie administrator/language/overrides/en-GB.override.ini).
K2_PLEASE_SELECT_A_MULTI_CATEGORY="Please select at least one category" K2_CATEGORY_MULTI="Multiple Categories" K2_MULTI_CATEGORY_LEGACY_MESG="This option is used for extra field support and by modules that rely on a single category selection."
You are done!
The tutorial above was made using FileZilla and phpMyAdmin to access FTP and the data base respectively. phpMyAdmin is usually available with most web hosting providers that use cPanel or Plesk control panels.