Keyword

Saving category results in 1054 error

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
8 months 2 weeks ago #171569 by Kelsey Brookes
Kelsey Brookes created the topic: Saving category results in 1054 error
As per this issue on the k2 github:

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.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
8 months 2 weeks ago #171574 by Fotis
Fotis replied the topic: Saving category results in 1054 error
Let's continue this over GitHub. I've responded there.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
1 week 2 days ago #173894 by Filip
Filip replied the topic: Saving category results in 1054 error
Hi. Since I upgraded K2 to 2.10.x I am getting this error when creating / saving CATEGORY. I know this has to do with Simple Image Gallery (3.6.6 version). I did debugging and it led me to line 67 in \plugins\k2\jw_sigpro\jw_sigpro.php:
$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.

More
1 week 2 days ago - 1 week 2 days ago #173895 by Filip
Filip replied the topic: Saving category results in 1054 error
UPDATE: When I manually added field "gallery" in #__k2_categories table in database, the same we have in #__k2_items, all works just fine!

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
Last edit: 1 week 2 days ago by Filip.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
1 week 2 days ago #173898 by Fotis
Fotis replied the topic: Saving category results in 1054 error
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!

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
1 week 2 days ago #173899 by Filip
Filip replied the topic: Saving category results in 1054 error

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.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
1 week 2 days ago #173900 by Fotis
Fotis replied the topic: Saving category results in 1054 error
K2 fires an event upon saving. However it's up to each plugin to respect "context".

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
1 week 1 day ago #173909 by Fotis
Fotis replied the topic: Saving category results in 1054 error
SIGPro has been updated to address this bug (among other things): www.joomlaworks.net/blog/item/295-simple-image-gallery-pro-v3-7-0-released

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum