Keyword

REQUEST: item->extra_fields to be decoded all the time...

  • harikaram
  • harikaram's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 5 months ago #84800 by harikaram
This is more of a request than a bug...In models/item.php on the frontend, lines 129-137:        //Extra fields        if(        ($view=='item' && $item->params->get('itemExtraFields')) ||        ($view=='itemlist' && ($task=='' || $task=='category') && $item->params->get('catItemExtraFields')) ||        ($view=='itemlist' && ($task=='search' || $task=='tag' || $task=='date') && $item->params->get('genericItemExtraFields'))        )        {            $item->extra_fields=K2ModelItem::getItemExtraFields($item->extra_fields);        }The ->extra_fields property only gets decoded from a JSON string if the params are set to output extra fields.  I'm using extra fields in a custom template and dont want them to output but wish to access them via code and use them for more bespoke purposes.  Right now I need an extra line in my template mimicking the above manually.I can't see any reason not to always convert the extra_fields param from JSON string into its object form...Also, perhaps a few more API hooks to in this model like getExtraFieldByName(), ...byId()  etc..Thx!

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


Powered by Kunena Forum