If the composer vendor directory is outside DRUPAL_ROOT
, the exporter classes are no longer listed because the path is not correct.
=> see function "getExporters()" (https://cgit.drupalcode.org/loft_data_grids/tree/src/LoftDataGrids.php?h=8.x-1.x)
In this function the path is defined more or less statically:
=> $path = DRUPAL_ROOT . '/vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/';
If I now install Drupal with the composer plugin "drupal-paranoia", this path is no longer correct.
Is there a way to dynamically determine the vendor directory via Drupal, or does it make sense to move the vendor directory path specification to a settings variable?
Like, for example: $settings['vendor_file_path'] = 'path/to/vendor/folder';
in settings.php
Comment | File | Size | Author |
---|---|---|---|
#3 | vendor_path_error-3042009-3.patch | 4.4 KB | medienverbinder |
#2 | 3042009-2.patch | 712 bytes | edysmp |
Comments
Comment #2
edysmpThis can be done using ReflectionClass.
Comment #3
medienverbinder CreditAttribution: medienverbinder as a volunteer commentedGreat! The patch works for me.
To prevent a WSOD, I would suggest to put the ReflectionClass call in a try, catch block, and display a message if a path error occurs. (Drupal\Core\Messenger\MessengerTrait)