I have a couple bootstrapped drush scripts I run for my project. They come in handy. Like I have one which pulls in the currencies from Drupal Commerce, uses a web service to get exchange rates for those currencies and updated an xml file which solr uses to perform on the fly currency sorts.

Problem is, after installing vat_number, this script stopped working.

Problem is, beacuse of require_once not using DRUPAL_ROOT in front of it.

Here's some discussion of the problem #376091: Add DRUPAL_ROOT to drupal_get_path()

Conslution seems to be to change it to module_load_include.

module_load_include is also what commerce uses.

Not sure where to best put this code, I assume in hook_init(), or simply just called before you use any of the _vat_* functions like in vat_number_field_widget_element_validate();

Comments

tim-diels’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
Related issues: +#2858797: code using the drupal systems outside of the drupal root

Looks like #2858797: code using the drupal systems outside of the drupal root had the same issue. Provided a possible solution there. Please review and reply in that issue if that works for you. Going to close this issue as outdated.