This repository has been archived by the owner on Apr 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #2982332 by Insasse, volkerk, webflo, daniel.bosen: New Riddle API
* fix for new api * fix test
- Loading branch information
Showing
9 changed files
with
129 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
riddle_marketplace: | ||
token: '' | ||
api_url: 'https://www.riddle.com/apiv3/item/token/%%TOKEN%%?client=d8' | ||
api_url: 'https://www.riddle.com/api/creators/riddle/get-list?token=%%TOKEN%%' | ||
url: 'https://www.riddle.com/a/%%RIDDLE_UID%%' | ||
empty_title_prefix: 'Riddle ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Post update functions. | ||
*/ | ||
|
||
/** | ||
* Set new api url if needed. | ||
*/ | ||
function riddle_marketplace_post_update_api_url() { | ||
$module_settings = Drupal::configFactory()->getEditable('riddle_marketplace.settings'); | ||
$api_url = $module_settings->get('riddle_marketplace.api_url'); | ||
$new_api_url = 'https://www.riddle.com/api/creators/riddle/get-list?token=%%TOKEN%%'; | ||
|
||
if ($api_url != $new_api_url) { | ||
$module_settings->set('riddle_marketplace.api_url', $new_api_url); | ||
$module_settings->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
#!/usr/bin/env bash | ||
# remove xdebug to make php execute faster | ||
phpenv config-rm xdebug.ini | ||
|
||
# globally require drupal coder for code tests | ||
composer global require drupal/coder | ||
composer global require "symfony/yaml:^3.4" "drupal/coder" | ||
|
||
# run phpcs | ||
phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer | ||
phpcs --standard=Drupal --report=summary -p . | ||
phpcs --standard=DrupalPractice --report=summary -p . | ||
phpcs --standard=Drupal --ignore=README.md -p . | ||
phpcs --standard=DrupalPractice -p . | ||
|
||
# JS ESLint checking | ||
mv ~/.nvm ~/.nvm-backup | ||
git clone https://github.com/creationix/nvm.git ~/.nvm | ||
(cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) | ||
set -x | ||
source ~/.nvm/nvm.sh | ||
set +x | ||
nvm install 4 | ||
nvm install 6 | ||
npm install -g eslint | ||
eslint . | ||
rm -rf ~/.nvm | ||
mv ~/.nvm-backup ~/.nvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.