Loading config/optional/views.view.views_json_source.yml +2 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ display: query: type: views_query options: json_file: /modules/contrib/views_json_source/data/sample/example1.json json_file: [site:url]modules/contrib/views_json_source/data/sample/example1.json row_apath: data/nodes show_errors: 1 exposed_form: Loading Loading @@ -195,7 +195,7 @@ display: query: type: views_query options: json_file: /modules/contrib/views_json_source/data/sample/example1.json json_file: [site:url]modules/contrib/views_json_source/data/sample/example1.json row_apath: data/nodes headers: '' show_errors: 1 Loading src/Plugin/views/query/ViewsJsonQuery.php +5 −1 Original line number Diff line number Diff line Loading @@ -193,6 +193,10 @@ class ViewsJsonQuery extends QueryPluginBase { try { // Replace any dynamic character if any. $url = $this->options['json_file']; // Replace any Drupal tokens in the url EG: [site:url] $url = \Drupal::token()->replace($url); while ($param = $this->getUrlParam()) { $url = preg_replace('/' . preg_quote('%', '/') . '/', $param, $url, 1); } Loading Loading @@ -479,7 +483,7 @@ class ViewsJsonQuery extends QueryPluginBase { '#type' => 'textfield', '#title' => $this->t('JSON File'), '#default_value' => $this->options['json_file'], '#description' => $this->t("The URL or relative path to the JSON file(starting with a slash \"/\")."), '#description' => $this->t("The URL or relative path to the JSON file(starting with a slash \"/\").<br />Note: Can use Drupal token as well."), '#maxlength' => 1024, ]; $form['row_apath'] = [ Loading Loading
config/optional/views.view.views_json_source.yml +2 −2 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ display: query: type: views_query options: json_file: /modules/contrib/views_json_source/data/sample/example1.json json_file: [site:url]modules/contrib/views_json_source/data/sample/example1.json row_apath: data/nodes show_errors: 1 exposed_form: Loading Loading @@ -195,7 +195,7 @@ display: query: type: views_query options: json_file: /modules/contrib/views_json_source/data/sample/example1.json json_file: [site:url]modules/contrib/views_json_source/data/sample/example1.json row_apath: data/nodes headers: '' show_errors: 1 Loading
src/Plugin/views/query/ViewsJsonQuery.php +5 −1 Original line number Diff line number Diff line Loading @@ -193,6 +193,10 @@ class ViewsJsonQuery extends QueryPluginBase { try { // Replace any dynamic character if any. $url = $this->options['json_file']; // Replace any Drupal tokens in the url EG: [site:url] $url = \Drupal::token()->replace($url); while ($param = $this->getUrlParam()) { $url = preg_replace('/' . preg_quote('%', '/') . '/', $param, $url, 1); } Loading Loading @@ -479,7 +483,7 @@ class ViewsJsonQuery extends QueryPluginBase { '#type' => 'textfield', '#title' => $this->t('JSON File'), '#default_value' => $this->options['json_file'], '#description' => $this->t("The URL or relative path to the JSON file(starting with a slash \"/\")."), '#description' => $this->t("The URL or relative path to the JSON file(starting with a slash \"/\").<br />Note: Can use Drupal token as well."), '#maxlength' => 1024, ]; $form['row_apath'] = [ Loading