COMMUNITY FORUM
Saving category results in 1054 error
- Kelsey Brookes
- Topic Author
- Offline
- Elite Member
github.com/getk2/k2/issues/477
When using the latest development build of K2 (to fix an entirely different issue), I ran into this one. When trying to save a category, I get the following error:
1054 Unknown column 'gallery' in 'field list'
I suspect this is due to SigPro, but can't be certain.
SigPro is v3.6.5, k2 is 2.9.1 [Dev build]
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Filip
- Offline
- New Member
$item->store();
Further, I see K2 v2.10.x has category model now and that's different than K2 v2.9.x. Now we have call in \administrator\components\com_k2\models\category.php, line 138:
// Trigger K2 plugins
$dispatcher->trigger('onAfterK2Save', array(&$row, $isNew));
All in all, I think onAfterK2Save SImple Image Gallery plugin function is now creating this problem. It does what it should but with K2 items, not categories!
At the end, category IS created and it works just fine, it just throws 1054 error since it can not find field "gallery" in #__k2_categories table.
Can you please confirm this?
never walk alone
Please Log in or Create an account to join the conversation.
- Filip
- Offline
- New Member
Consequence would be that we can make duplicate (or overwrite) item gallery, since it's created by automation, giving folder name by item ID. If category has the same ID as item - we have "problem". Still, this can not happen for now, since we have no actual tab for SImple Image Gallery in category creation. So this is just workaround solution for 1054 error. I don't like it, though. Thank you for all the great work with K2 one more time!
never walk alone
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
I'll patch SIGPro and release an update tomorrow.
@Kelsey you were right all along man!
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Filip
- Offline
- New Member
Fotis wrote: You're right on that, but it's best to fix that behaviour in SIGPro than adding a table in K2. The trick is to put context for the K2 plugin of SIGPro so that it executes that event (onAfterK2Save) only in the "item" view (=the item edit form).
I'll patch SIGPro and release an update tomorrow.
@Kelsey you were right all along man!
Yes, exactly what I had on mind. Maybe similar update on K2 component side too?
Thank you for confirmation and quick reaction!
Cheers
never walk alone
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.