- Posts: 3
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Dissappearing items - multiple categories for k2 - extension bug
Dissappearing items - multiple categories for k2 - extension bug
- rzrwolf
- Topic Author
- Offline
- New Member
Less
More
1 year 11 months ago - 1 year 11 months ago #180672
by rzrwolf
Dissappearing items - multiple categories for k2 - extension bug was created 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:
Can someone elaborate in fixing the issue? I have contacted the developer web357 for almost a year about it and never got any answer,
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:
The function does not check whether k2 category or k2 item is saved and removes both ID records in table _k2_multiple_categoriesfunction 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);
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
1 year 11 months ago - 1 year 11 months ago #180673
by rzrwolf
Replied by rzrwolf on topic Dissappearing items - multiple categories for k2 - extension bug
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);
}
/**
* 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.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6220
1 year 11 months ago #180675
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Dissappearing items - multiple categories for k2 - extension bug
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
1 year 11 months ago #180676
by rzrwolf
Replied by rzrwolf on topic Dissappearing items - multiple categories for k2 - extension bug
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
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.
- Forum
- K2 Community Forum
- English K2 Community
- Dissappearing items - multiple categories for k2 - extension bug