Keyword

Dissappearing items - multiple categories for k2 - extension bug

  • rzrwolf
  • rzrwolf's Avatar Topic Author
  • Offline
  • New Member
More
1 year 11 months ago - 1 year 11 months ago #180672 by rzrwolf
Hello!

I have observed persistent bug with multiple categories for k2 when updating k2 category description..

When i update category description and save - one random k2 item dissappears from frontend..

When i edit the k2 category with id (for example "10") and there is any k2 item with ID=10 - the extension deletes the record for k2 item with ID '10', Basically the extension deletes its own table record incorrectly..

The error is in:

function onAfterK2Save($item, $isNew)
    {
        // Database Connection
        $db = JFactory::getDbo();

        /**
         * Delete everything first
         */
        $query = $db->getQuery(true);
        $conditions = array($db->quoteName('item_id') . ' = '.$item->id);
        $query->delete($db->quoteName('#__k2_multiple_categories'));
        $query->where($conditions);

The function does not check whether k2 category or k2 item is saved and removes both ID records in table _k2_multiple_categories

Can someone elaborate in fixing the issue? I have contacted the developer web357 for almost a year about it and never got any answer,
 
Last edit: 1 year 11 months ago by rzrwolf.

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

  • rzrwolf
  • rzrwolf's Avatar Topic Author
  • Offline
  • New Member
More
1 year 11 months ago - 1 year 11 months ago #180673 by rzrwolf
OK, my suggested FIX is adding this to @k2multiplecategories php file

/**
* Delete everything first
*/
if ($item == 'TableK2Item') {
$query = $db->getQuery(true);
$conditions = array($db->quoteName('item_id') . ' = '.$item->id);
$query->delete($db->quoteName('#__k2_multiple_categories'));
$query->where($conditions);
}
Last edit: 1 year 11 months ago by rzrwolf.

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

More
1 year 11 months ago #180675 by JoomlaWorks
If you're referring to "Multiple Categories for K2" by Web357, you should probably ask its developer directly.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • rzrwolf
  • rzrwolf's Avatar Topic Author
  • Offline
  • New Member
More
1 year 11 months ago #180676 by rzrwolf
Yes, i am referring to this extension.

The reason i post it here is that developer stopped responding to support tickets almost a year from now.

The fix is working and for those who use this extension - this may be a solution to their problems with this extension.

If someone can contact Web357 and talk to developer - that would be great

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


Powered by Kunena Forum