Forum Discussion

luk's avatar
luk
Boss
6 years ago

API & FreeMarker Issue Tracker

As there is no public issue tracker (afaik) or reporting workflow (other than support tickets and ideas), I'd like to collect some things that were found trough hour-long trial end error (some including workarounds) so others trying to customize the platform hopefully don't have to jump trough the same hoops as I had to or at least might be able to find some information or workarounds regarding things that don't behave as advertised or expected.

This topic is NOT a place to rant about the platform, the devs or the product (it's software after all, and software has bugs, we know that very well...).

I will make a new reply to this post for each issue and link them in the topic message for easier access.

Hope it helps somebody!

PS: If you know about something similar and it's not yet listed below, please feel free to add your own reply to the original topic message using the template below as a rough guideline of what information to provide. If you'd like to comment on a bug, try to reply to that specific "issue" message (so technically a threaded view could be aggregated, it's not right here, I know...) and reference (via permalink!) the issue you're commenting on, otherwise it's going to be very confusing =)...
______


Issues:

  • #1: API v2 function count(topic) does not work.
  • #2: API v2 response structure should be normalized.
  • #3: FreeMarker context object apiv2.toJson() fails with "augmented" API response objects.

 

<!-- Issue Template -->
<p>
	<strong>Issue</strong>: #<br />
	<strong>Type</strong>: BUG | INCONSISTENCY | FEATURE<br />
	<strong>Area</strong>: REST API v1 | REST API v2 | FreeMarker<br />
	<strong>Collection</strong>: API collection if applicable<br />
	<strong>Platform Version</strong>: &lt;= xx.x (if fixed &gt;= xx.x)<br />
	<strong>Summary</strong>: Summary sentence goes here.<br />
	<strong>Ping</strong>: @mention a user if applicable<br />
</p>

<p><strong>ISSUE SUMMARY</strong>: Short summary of issue, what is expected and what is actually happening.</p>

<p>Detailed description/explanation/workaround</p>

 

20 Replies

  • This post is great and really helpful! Thank you mate!

  • luk's avatar
    luk
    Boss
    5 years ago

    Allow me to disagree, we (normal users) do not have the permissions to edit/update TKB articles here, so we couldn't change it anymore.

  • luk's avatar
    luk
    Boss
    5 years ago

    SuzieH yap, great! Seems I can edit the posts, thank you! There is a bunch of stuff in preparation, takes some time to compile it though =)...

  • SuzieH   Khoros Freemarker version is a bit out-dated. It does not support Array?map function. Maybe Khoros should upgrade to the latest stable version? It is currently using FreeMarker 2.3.26-incubating

     

    2.3.31
    2.3.30
    2.3.29
    2.3.28
    2.3.27 (incubating at Apache)
    2.3.26 (incubating at Apache)
    2.3.25 (incubating at Apache)
    2.3.24 (incubating at Apache)
    2.3.23

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    4 years ago

    Good question peterlu
    RayC is a FreeMarker upgrade anywhere on our Community roadmap?

  • Issue: #?
    Type: BUG
    Area: REST API v2
    Collection: settings
    Platform Version: >= 22.12?
    Summary: Per Khoros Support, Community 22.12 broke the API V2 field-setting capability.
    Ping: not sure who's in charge

    ISSUE SUMMARY: Kudos to keithkelly for reporting that publicly, it seems that if you do a query like SELECT * FROM settings WHERE id = 'c_custom_field_name' AND user.id = '409' won't work properly, not confirmed for all types of requests, but at least POST requests to update a setting value seem to be affected. If someone has more info, please let me know. For some reason I also can't find the settings collection anymore in the API v2 docs, I was pretty sure it was there at some point, was this removed?

  • Details about this in case it helps anyone who stumbles across it:

    Bug ID: 00407790   Submitted 2/10/23

    Setting Custom Board Property (is no longer working)

    Description:

    I have some PostMan scripts that I used a couple months ago to set the "c_dc_scope" board property successfully.  However, this is no longer working, even when I set the user to have Administrator permissions.

    This acts successful, but the value isn't updated

     

    Workaround provided by Khoros Support (and worked) was to use:

     

    curl --location --request POST 'https://[COMMUNITY URL]/restapi/vc/boards/id/[BOARD ID]/settings/name/custom.dc_scope/set?value=foo' \
    --header 'Accept: application/json' \
    --header 'Content-Type: application/json' \
    --header 'li-api-session-key: SESSION_KEY' \
    --data-raw '{
    "data": {
    "type": "board",
    "c_dc_scope": "foo"
    }
    }' 

     

     

  • <#assign qry = "SELECT id FROM images WHERE visibility = 'public' AND owner.id = '100' limit 1" />
    
    <#assign response = (restBuilder().asIdentityUser('/users/id/100').liql(qry).data.items[0])!{} />
    response user 100 image = ${response.id}

     

    I am getting a permission error. If I remove "asIdentityUser('/users/id/100')", then it is working fine. I am testing this endpoint code in incognito mode.

    It is complaining about some permission issue when I test it in incognito mode.

    Any ideas? The logic is fetch user 100's public image, run the api as user identity 100.

  • Hello peterlu,

    That's expected behavior if the currently authenticated user doesn't have the switch user permission, and using an Incognito Window would mean they're anonymous.