Keyword

Bug: Extra Fields return null on parse

More
10 years 1 month ago #130910 by Simon
Hello,

Joomla Version: 3.3.1
K2 Version: 2.6.8

Situation
I've just started using K2 and am interested in creating some modules for it; documentation is however a little on the...light side. My goal is curretly to create a module that makes use of extra_fields.
Problem
I performed the SELECt query without issue that returns the following extra_fields:
[{"id":"1","value":"1"}
Nothing special as you can see. However, when I tried to use the Item Model and getItemExtraFields I would find it only ever returned null. This didn't happen with any new items I had created or after updating the item itself and left me scratching my head
What resolved the matter (short term solution)
I had added some extra fields without updating the item itself. Instead of the above array, K2 was actually expecting the following:
[{"id":"1","value":"1"},{"id":"2","value":""}]
Once this other field was there (even if empty) the function would return the correct values.

Now, I've not got the time to root through the code fully at present and I've only just started acquainting myself with K2 so, the hope is that in the long term either I will develop using K2 again and identify where this bug exists or someone else can help shed some light on it. Doing it for the community either way :)

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


Powered by Kunena Forum