Use Riddle API v2

Created on 14 August 2020, almost 4 years ago
Updated 25 April 2023, about 1 year ago

Problem/Motivation

Since November 2019 the old API has been deprecated. See: https://www.riddle.com/docs/api/riddles/get-riddle-embed-code/
It is now recommended to use https://www.riddle.com/docs/api/api-v2-documentation/
The authentication method has been altered so we need 2 fields in the settings form. One for the token and one for the api key.

Also, the import Riddles method in the media entities overview didn't show the local action used an incorrect route.

Finally, the readme still mentions a custom paragraph type, even though in version 3 there is no longer a paragraphs submodule, just a media submodule.

Proposed resolution

I've updated the RiddleFeedService to use the new v2 riddle api. Including the new authentication method.

Remaining tasks

Create a hook_update_N() implementation to update the old 'token' setting to the new 'api_token' setting. And force update of the api_url within the immutable config storage.

User interface changes

Enabled the "import riddles" local action button on /admin/content/media

Data model changes

The riddle_marketplace.settings config now has a a) new api_url value, b) the token property has been renamed api_token, and c) there is a new property called api_key.

✨ Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands basvredeling Amsterdam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany osopolar πŸ‡©πŸ‡ͺ GER 🌐

    Thank you dejan0, your patch from #12 worked for me also to be able to access text format pages like admin/config/content/formats/manage/basic_html

  • Status changed to Needs work about 1 year ago
  • πŸ‡©πŸ‡ͺGermany osopolar πŸ‡©πŸ‡ͺ GER 🌐

    I found that updating after patching the module did not update the riddle_marketplace.api_url

    Documentation for hook_post_update_NAME says:

    Drupal also ensures to not execute the same hook_post_update_NAME() function twice.

    Therefore I assume a new hook_post_update_NAME function needs to be added to riddle_marketplace.post_update.php and implement the changes.

    As workaround I just edited the exported riddle_marketplace.settings.yml file and imported it again.

Production build 0.69.0 2024