By paulcap1


2019-02-08 12:46:28 8 Comments

I want to execute a View and export the JSON file to the files directory. I am using Views Data Export and VDE drush add-on modules. My view has a file/PDF field and I want to provide a direct link to the PDF file. So I added a Views relation for the field and a file URI formatter field. When I go to see the output the View creates at the Path. The URL is an absolute link directly to the PDF file. The URL includes the domain name when viewing it on development or production instances. And this is what I want. This is the correct URL path in the JSON:

href=\u0022http:\/\/mysite.com\/files\/Allergens.pdf

But when I use this Drush command below provided by views_data_export or vde_drush

drush vde myview myviewid myfile.json 

the domain name is stripped out like this:

href=\u0022http:\/\/default\/files\/Allergens.pdf

Why is this happening only when using the Drush command? I found I can fix it by adding this at the end of the command

--uri=mysite.com

So my new drush command looks like this:

drush vde myview myviewid myfile.json --uri=mysite.com

But doing this will hardcode the domain name into the URL. I want the URL to work on development, production and on my local. Thank you for any help you can provide.

0 comments

Related Questions

Sponsored Content

0 Answered Questions

Error on drush command: In ThemeHandler.php The theme does not exist

  • 2019-01-08 12:23:27
  • NexusStar
  • 52 View
  • 0 Score
  • 0 Answer
  • Tags:   8 theming drush

1 Answered Questions

2 Answered Questions

[SOLVED] Drush php-script | Drupal functions such as node_load() are not being found

  • 2014-06-28 07:51:17
  • Francisco Luz
  • 805 View
  • 1 Score
  • 2 Answer
  • Tags:   drush

2 Answered Questions

[SOLVED] How to integrate the drush help --filter option with your custom module?

  • 2016-09-09 16:44:22
  • Adrian Cid Almaguer
  • 132 View
  • 5 Score
  • 2 Answer
  • Tags:   drush

2 Answered Questions

[SOLVED] Drush 8.1.2 is not working on Windows

  • 2016-06-19 14:45:09
  • Rajesh Vishwakarma
  • 561 View
  • 1 Score
  • 2 Answer
  • Tags:   drush

1 Answered Questions

Drush do not autocomplete files and directory names

  • 2016-10-07 15:53:35
  • juankvillegas
  • 64 View
  • 0 Score
  • 1 Answer
  • Tags:   drush

2 Answered Questions

[SOLVED] Drush commands report "hostname: Name or service not known"

  • 2014-12-12 01:48:06
  • John
  • 2530 View
  • 3 Score
  • 2 Answer
  • Tags:   drush

0 Answered Questions

Drush hangs only when executing a command on a remote machine

  • 2016-03-21 19:31:15
  • Stuart Parker
  • 114 View
  • 1 Score
  • 0 Answer
  • Tags:   drush ssh

2 Answered Questions

[SOLVED] What does URI mean in drush site alias?

  • 2011-11-14 20:35:53
  • mtro
  • 3739 View
  • 4 Score
  • 2 Answer
  • Tags:   drush

1 Answered Questions

[SOLVED] drush site synchronization with aliases

  • 2012-03-04 08:26:48
  • Hubidubi
  • 884 View
  • 0 Score
  • 1 Answer
  • Tags:   drush

Sponsored Content